Koomemartin commited on
Commit
84f5525
·
verified ·
1 Parent(s): 15a76e8

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -5
app.py CHANGED
@@ -122,7 +122,7 @@ if user_query:
122
  temperature=0.8,
123
  max_tokens=2042,
124
  top_p=0.6,
125
- stream=True,
126
  )
127
  # st.write('Passed model')
128
 
@@ -130,10 +130,11 @@ if user_query:
130
  st.error(f"Failed to process query to model: {e}")
131
  response = ""
132
  try:
133
- for chunk in chat_streaming:
134
- content = chunk.choices[0].delta.content
135
- if content: # Ensure content is not None
136
- response += content
 
137
  st.write("🤖:")
138
  st.write(response)
139
  except Exception as e:
 
122
  temperature=0.8,
123
  max_tokens=2042,
124
  top_p=0.6,
125
+ stream=False,
126
  )
127
  # st.write('Passed model')
128
 
 
130
  st.error(f"Failed to process query to model: {e}")
131
  response = ""
132
  try:
133
+ # for chunk in chat_streaming:
134
+ # content = chunk.choices[0].delta.content
135
+ # if content: # Ensure content is not None
136
+ response=chat_streaming.choices[0].message.content
137
+ # response += content
138
  st.write("🤖:")
139
  st.write(response)
140
  except Exception as e: