Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -51,7 +51,6 @@ def stream_chat(message: str, history: list, temperature: float, max_new_tokens:
|
|
51 |
|
52 |
|
53 |
generate_kwargs = dict(
|
54 |
-
input_ids=input_ids,
|
55 |
max_length=2500,
|
56 |
max_new_tokens=max_new_tokens,
|
57 |
do_sample=True,
|
@@ -61,7 +60,7 @@ def stream_chat(message: str, history: list, temperature: float, max_new_tokens:
|
|
61 |
)
|
62 |
|
63 |
with torch.no_grad():
|
64 |
-
outputs = model.generate(**generate_kwargs)
|
65 |
outputs = outputs[:, inputs['input_ids'].shape[1]:]
|
66 |
results = tokenizer.decode(outputs[0], skip_special_tokens=True)
|
67 |
return results
|
|
|
51 |
|
52 |
|
53 |
generate_kwargs = dict(
|
|
|
54 |
max_length=2500,
|
55 |
max_new_tokens=max_new_tokens,
|
56 |
do_sample=True,
|
|
|
60 |
)
|
61 |
|
62 |
with torch.no_grad():
|
63 |
+
outputs = model.generate(**inputs, **generate_kwargs)
|
64 |
outputs = outputs[:, inputs['input_ids'].shape[1]:]
|
65 |
results = tokenizer.decode(outputs[0], skip_special_tokens=True)
|
66 |
return results
|