jchwenger
commited on
Commit
·
57543bf
1
Parent(s):
879656b
app | no timeout
Browse files
app.py
CHANGED
@@ -74,7 +74,12 @@ def predict(message, history):
|
|
74 |
# convert the string into tensors & move to GPU
|
75 |
model_inputs = tokenizer([messages], return_tensors="pt").to(device)
|
76 |
|
77 |
-
streamer = TextIteratorStreamer(
|
|
|
|
|
|
|
|
|
|
|
78 |
generate_kwargs = dict(
|
79 |
model_inputs,
|
80 |
streamer=streamer,
|
|
|
74 |
# convert the string into tensors & move to GPU
|
75 |
model_inputs = tokenizer([messages], return_tensors="pt").to(device)
|
76 |
|
77 |
+
streamer = TextIteratorStreamer(
|
78 |
+
tokenizer,
|
79 |
+
# timeout=30., # no timeout until I implement error handling for the empty stream
|
80 |
+
skip_prompt=True,
|
81 |
+
skip_special_tokens=True
|
82 |
+
)
|
83 |
generate_kwargs = dict(
|
84 |
model_inputs,
|
85 |
streamer=streamer,
|