Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -21,7 +21,7 @@ def run_generation(user_text, use_assistant, temperature, max_new_tokens):
|
|
21 |
do_sample = True
|
22 |
|
23 |
# Get the model and tokenizer, and tokenize the user text.
|
24 |
-
model_inputs = tokenizer([user_text], return_tensors="pt").to(
|
25 |
|
26 |
# Start generation on a separate thread, so that we don't block the UI. The text is pulled from the streamer
|
27 |
# in the main thread. Adds timeout to the streamer to handle exceptions in the generation thread.
|
|
|
21 |
do_sample = True
|
22 |
|
23 |
# Get the model and tokenizer, and tokenize the user text.
|
24 |
+
model_inputs = tokenizer([user_text], return_tensors="pt").to(model.device)
|
25 |
|
26 |
# Start generation on a separate thread, so that we don't block the UI. The text is pulled from the streamer
|
27 |
# in the main thread. Adds timeout to the streamer to handle exceptions in the generation thread.
|