Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -59,16 +59,14 @@ Description: """
|
|
59 |
add_special_tokens=True
|
60 |
)
|
61 |
|
62 |
-
|
63 |
-
min_length = inputs['input_ids'].shape[1] + 20
|
64 |
|
65 |
# Generate response
|
66 |
with torch.no_grad():
|
67 |
outputs = model.generate(
|
68 |
input_ids=inputs['input_ids'],
|
69 |
attention_mask=inputs['attention_mask'],
|
70 |
-
|
71 |
-
min_length=min_length,
|
72 |
temperature=temperature,
|
73 |
top_p=top_p,
|
74 |
do_sample=True,
|
|
|
59 |
add_special_tokens=True
|
60 |
)
|
61 |
|
62 |
+
input_length = inputs['input_ids'].shape[1]
|
|
|
63 |
|
64 |
# Generate response
|
65 |
with torch.no_grad():
|
66 |
outputs = model.generate(
|
67 |
input_ids=inputs['input_ids'],
|
68 |
attention_mask=inputs['attention_mask'],
|
69 |
+
max_new_tokens=max_length, # Changed to max_new_tokens
|
|
|
70 |
temperature=temperature,
|
71 |
top_p=top_p,
|
72 |
do_sample=True,
|