Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -205,9 +205,18 @@ def generate_response(input_dict):
|
|
205 |
**inputs,
|
206 |
max_new_tokens=512,
|
207 |
temperature=0.7,
|
208 |
-
do_sample=True
|
|
|
209 |
)
|
210 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
211 |
|
212 |
|
213 |
|
|
|
205 |
**inputs,
|
206 |
max_new_tokens=512,
|
207 |
temperature=0.7,
|
208 |
+
do_sample=True,
|
209 |
+
pad_token_id=tokenizer.eos_token_id # avoids warning
|
210 |
)
|
211 |
+
decoded = tokenizer.decode(outputs[0], skip_special_tokens=True)
|
212 |
+
|
213 |
+
# Print for debugging
|
214 |
+
print("🔍 Full LLM Output:\n", decoded)
|
215 |
+
|
216 |
+
|
217 |
+
response_only = decoded[len(prompt):].strip()
|
218 |
+
return response_only
|
219 |
+
|
220 |
|
221 |
|
222 |
|