PierreJousselin commited on
Commit
a71971f
·
verified ·
1 Parent(s): 89612ca

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -1
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)