Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -37,7 +37,7 @@ def generate_text(prompt, max_length, repetition_penalty, temperature):
|
|
| 37 |
)
|
| 38 |
|
| 39 |
# Decode the generated tokens and return the result
|
| 40 |
-
generated_text = tokenizer.batch_decode(outputs[:, input_ids.shape[
|
| 41 |
return generated_text
|
| 42 |
|
| 43 |
# Create the Gradio interface
|
|
|
|
| 37 |
)
|
| 38 |
|
| 39 |
# Decode the generated tokens and return the result
|
| 40 |
+
generated_text = tokenizer.batch_decode(outputs[:, input_ids.shape[1]:-1], skip_special_tokens=True)[0].strip()
|
| 41 |
return generated_text
|
| 42 |
|
| 43 |
# Create the Gradio interface
|