Spaces:
Runtime error
Runtime error
test
Browse files
app.py
CHANGED
@@ -59,10 +59,13 @@ def respond(
|
|
59 |
add_generation_prompt = True, # Must add for generation
|
60 |
return_tensors = "pt",
|
61 |
)
|
62 |
-
text_streamer = TextStreamer(tokenizer, skip_prompt = True)
|
63 |
-
for response in model.generate(input_ids = inputs, streamer = text_streamer, max_new_tokens = max_tokens, use_cache = True,
|
64 |
-
|
65 |
-
|
|
|
|
|
|
|
66 |
|
67 |
|
68 |
"""
|
|
|
59 |
add_generation_prompt = True, # Must add for generation
|
60 |
return_tensors = "pt",
|
61 |
)
|
62 |
+
# text_streamer = TextStreamer(tokenizer, skip_prompt = True)
|
63 |
+
# for response in model.generate(input_ids = inputs, streamer = text_streamer, max_new_tokens = max_tokens, use_cache = True,
|
64 |
+
# temperature = temperature, min_p = top_p):
|
65 |
+
# yield response
|
66 |
+
outputs = model.generate(input_ids = inputs, max_new_tokens = max_tokens, use_cache = True,
|
67 |
+
temperature = temperature, min_p = top_p)
|
68 |
+
return tokenizer.batch_decode(outputs)
|
69 |
|
70 |
|
71 |
"""
|