Spaces:
Sleeping
Sleeping
Commit
·
37e3916
1
Parent(s):
89166c3
Update app.py
Browse files
app.py
CHANGED
@@ -19,11 +19,10 @@ if st.button("Submit", type="primary"):
|
|
19 |
messages=[{"role": "user", "content": input}],
|
20 |
stream=True,
|
21 |
):
|
22 |
-
|
23 |
-
if
|
24 |
-
|
25 |
-
|
26 |
-
result = ""
|
27 |
result = result.replace("\n", "")
|
28 |
res_box.markdown(result)
|
29 |
st.markdown("----")
|
|
|
19 |
messages=[{"role": "user", "content": input}],
|
20 |
stream=True,
|
21 |
):
|
22 |
+
chunk_content = chunk["choices"][0].get("delta", {}).get("content")
|
23 |
+
if chunk_content is not None:
|
24 |
+
content.append(chunk_content)
|
25 |
+
result = "".join(content).strip()
|
|
|
26 |
result = result.replace("\n", "")
|
27 |
res_box.markdown(result)
|
28 |
st.markdown("----")
|