Update Space
Browse files
app.py
CHANGED
@@ -113,20 +113,8 @@ def respond(message, history, system_message, max_tokens, temperature, top_p):
|
|
113 |
# 3) Generate the assistant response from your HF model.
|
114 |
# (This code streams token-by-token.)
|
115 |
response = ""
|
116 |
-
|
117 |
-
|
118 |
-
max_tokens=max_tokens,
|
119 |
-
stream=True,
|
120 |
-
temperature=temperature,
|
121 |
-
top_p=top_p,
|
122 |
-
):
|
123 |
-
token = resp_chunk.choices[0].delta.get("content", "")
|
124 |
-
response += token
|
125 |
-
|
126 |
-
# If you want to display the partial response with the EOU probability
|
127 |
-
# appended at the bottom, you can do so each step. For cleanliness,
|
128 |
-
# we'll do it in-line as a bracketed note at the end.
|
129 |
-
yield response + f"\n\n[EOU Probability: {eou_prob:.4f}]"
|
130 |
|
131 |
# ------------------------------------------------
|
132 |
# Gradio ChatInterface
|
|
|
113 |
# 3) Generate the assistant response from your HF model.
|
114 |
# (This code streams token-by-token.)
|
115 |
response = ""
|
116 |
+
|
117 |
+
yield f"[EOU Probability: {eou_prob:.4f}]"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
118 |
|
119 |
# ------------------------------------------------
|
120 |
# Gradio ChatInterface
|