Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -16,7 +16,7 @@ def chat_with_bot(prompt):
|
|
16 |
length = 18 + len(prompt)
|
17 |
# Generate a response
|
18 |
with torch.no_grad():
|
19 |
-
outputs =
|
20 |
|
21 |
# Decode and return the response
|
22 |
response = tokenizer.decode(outputs[0], skip_special_tokens=True)
|
|
|
16 |
length = 18 + len(prompt)
|
17 |
# Generate a response
|
18 |
with torch.no_grad():
|
19 |
+
outputs = model.generate(inputs['input_ids'], attention_mask=inputs['attention_mask'],max_new_tokens=50, num_return_sequences=1, pad_token_id=tokenizer.pad_token_id)
|
20 |
|
21 |
# Decode and return the response
|
22 |
response = tokenizer.decode(outputs[0], skip_special_tokens=True)
|