Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -26,7 +26,7 @@ def chat_with_distilgpt2(input_text):
|
|
| 26 |
input_ids = tokenizer.encode(full_input, return_tensors="pt").to(device)
|
| 27 |
|
| 28 |
# Generate the response using the model
|
| 29 |
-
outputs = model.generate(input_ids, max_length=
|
| 30 |
|
| 31 |
# Decode the model output
|
| 32 |
response = tokenizer.decode(outputs[0], skip_special_tokens=True)
|
|
|
|
| 26 |
input_ids = tokenizer.encode(full_input, return_tensors="pt").to(device)
|
| 27 |
|
| 28 |
# Generate the response using the model
|
| 29 |
+
outputs = model.generate(input_ids, max_length=400, num_return_sequences=1, pad_token_id=tokenizer.eos_token_id)
|
| 30 |
|
| 31 |
# Decode the model output
|
| 32 |
response = tokenizer.decode(outputs[0], skip_special_tokens=True)
|