Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -14,7 +14,7 @@ def generate_text(input_text):
|
|
| 14 |
return "Error: Model could not be loaded. Check your Hugging Face space logs."
|
| 15 |
|
| 16 |
try:
|
| 17 |
-
output = model(input_text, max_length=
|
| 18 |
return output[0]["generated_text"]
|
| 19 |
except Exception as e:
|
| 20 |
return f"Error generating text: {e}"
|
|
|
|
| 14 |
return "Error: Model could not be loaded. Check your Hugging Face space logs."
|
| 15 |
|
| 16 |
try:
|
| 17 |
+
output = model(input_text, max_length=30, truncation=True) # Explicit truncation added
|
| 18 |
return output[0]["generated_text"]
|
| 19 |
except Exception as e:
|
| 20 |
return f"Error generating text: {e}"
|