Spaces:
Sleeping
Sleeping
PierreJousselin
commited on
Update app.py
Browse files
app.py
CHANGED
@@ -27,7 +27,7 @@ def generate_response(prompt):
|
|
27 |
input_ids = inputs["input_ids"].to("cpu")
|
28 |
print(input_ids)
|
29 |
# Generate output (ensure it's on CPU)
|
30 |
-
output = model.generate(input_ids, max_length=
|
31 |
|
32 |
# Decode and return response
|
33 |
response = tokenizer.decode(output[0], skip_special_tokens=True)
|
|
|
27 |
input_ids = inputs["input_ids"].to("cpu")
|
28 |
print(input_ids)
|
29 |
# Generate output (ensure it's on CPU)
|
30 |
+
output = model.generate(input_ids, max_length=300, num_return_sequences=1,pad_token_id=tokenizer.eos_token_id)
|
31 |
|
32 |
# Decode and return response
|
33 |
response = tokenizer.decode(output[0], skip_special_tokens=True)
|