Spaces:
Sleeping
Sleeping
PierreJousselin
commited on
Update app.py
Browse files
app.py
CHANGED
@@ -19,7 +19,7 @@ def generate_response(prompt):
|
|
19 |
input_ids = inputs["input_ids"].to("cpu")
|
20 |
print(input_ids)
|
21 |
# Generate output (ensure it's on CPU)
|
22 |
-
output = model.generate(input_ids, max_length=150, num_return_sequences=1)
|
23 |
|
24 |
# Decode and return response
|
25 |
response = tokenizer.decode(output[0], skip_special_tokens=True)
|
|
|
19 |
input_ids = inputs["input_ids"].to("cpu")
|
20 |
print(input_ids)
|
21 |
# Generate output (ensure it's on CPU)
|
22 |
+
output = model.generate(input_ids, max_length=150, num_return_sequences=1,pad_token_id=tokenizer.eos_token_id)
|
23 |
|
24 |
# Decode and return response
|
25 |
response = tokenizer.decode(output[0], skip_special_tokens=True)
|