keisuke-tada commited on
Commit
37e3916
·
1 Parent(s): 89166c3

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -5
app.py CHANGED
@@ -19,11 +19,10 @@ if st.button("Submit", type="primary"):
19
  messages=[{"role": "user", "content": input}],
20
  stream=True,
21
  ):
22
- content.append(chunk["choices"][0].get("delta", {}).get("content"))
23
- if content is not None:
24
- result = "".join(content).strip()
25
- else:
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("----")