Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -23,10 +23,12 @@ config = GenerationConfig(
|
|
23 |
stop_strings=set(["<|eot_id|>"]) # ✅ 這是 set
|
24 |
)
|
25 |
|
|
|
26 |
def streamer(subword):
|
27 |
-
global output_buffer
|
28 |
-
output_buffer += subword
|
29 |
print(subword, end='', flush=True)
|
|
|
|
|
|
|
30 |
|
31 |
# 推理函式
|
32 |
def generate_response(prompt, model_name):
|
|
|
23 |
stop_strings=set(["<|eot_id|>"]) # ✅ 這是 set
|
24 |
)
|
25 |
|
26 |
+
# Create a streamer function
|
27 |
def streamer(subword):
|
|
|
|
|
28 |
print(subword, end='', flush=True)
|
29 |
+
# Return flag corresponds whether generation should be stopped.
|
30 |
+
return ov_genai.StreamingStatus.RUNNING
|
31 |
+
|
32 |
|
33 |
# 推理函式
|
34 |
def generate_response(prompt, model_name):
|