Spaces:
Paused
Paused
Update app.py
Browse files
app.py
CHANGED
@@ -46,9 +46,9 @@ def generate_text(user_input):
|
|
46 |
# Decode the model output and return the result
|
47 |
decoded_output = tokenizer.decode(output[0], skip_special_tokens=True)
|
48 |
|
49 |
-
|
50 |
-
|
51 |
-
return
|
52 |
|
53 |
# Fallback: return full decoded output if structure is unexpected
|
54 |
return decoded_output
|
|
|
46 |
# Decode the model output and return the result
|
47 |
decoded_output = tokenizer.decode(output[0], skip_special_tokens=True)
|
48 |
|
49 |
+
index = decoded_output.lower().find("model")
|
50 |
+
if index != -1:
|
51 |
+
return decoded_output[index + len("model"):].strip()
|
52 |
|
53 |
# Fallback: return full decoded output if structure is unexpected
|
54 |
return decoded_output
|