Spaces:
Sleeping
Sleeping
update
Browse files
app.py
CHANGED
|
@@ -36,10 +36,10 @@ def respond(
|
|
| 36 |
model_inputs = generate_custom_mask(tokenizer, [prompt], device)
|
| 37 |
|
| 38 |
outputs = model.generate(temperature=0.7, max_tokens=32, **model_inputs)
|
| 39 |
-
|
| 40 |
result = tokenizer.batch_decode(outputs, skip_special_tokens=True)
|
| 41 |
|
| 42 |
-
return
|
| 43 |
|
| 44 |
"""
|
| 45 |
For information on how to customize the ChatInterface, peruse the gradio docs: https://www.gradio.app/docs/chatinterface
|
|
|
|
| 36 |
model_inputs = generate_custom_mask(tokenizer, [prompt], device)
|
| 37 |
|
| 38 |
outputs = model.generate(temperature=0.7, max_tokens=32, **model_inputs)
|
| 39 |
+
outputs = outputs[:, model_inputs['input_ids'].shape[1]:]
|
| 40 |
result = tokenizer.batch_decode(outputs, skip_special_tokens=True)
|
| 41 |
|
| 42 |
+
return result
|
| 43 |
|
| 44 |
"""
|
| 45 |
For information on how to customize the ChatInterface, peruse the gradio docs: https://www.gradio.app/docs/chatinterface
|