keisuke-tada commited on
Commit
e765b22
·
1 Parent(s): 86b5c4d

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -1
app.py CHANGED
@@ -20,7 +20,10 @@ if st.button("Submit", type="primary"):
20
  stream=True,
21
  ):
22
  content.append(chunk["choices"][0].get("delta", {}).get("content"))
23
- result = "".join(content).strip()
 
 
 
24
  result = result.replace("\n", "")
25
  res_box.markdown(result)
26
  st.markdown("----")
 
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("----")