Spaces:
Sleeping
Sleeping
Commit
·
3b6d04c
1
Parent(s):
ebf5b35
11
Browse files
app.py
CHANGED
|
@@ -215,7 +215,7 @@ def initialize_app(added_files, num_lessons, language):
|
|
| 215 |
tmp.write(added_file.getvalue())
|
| 216 |
tmp_path = tmp.name
|
| 217 |
temp_file_paths.append(tmp_path)
|
| 218 |
-
st.success('Processing file...Done
|
| 219 |
|
| 220 |
with st.spinner('Constructing vector database from provided materials...'):
|
| 221 |
embeddings_df, faiss_index = constructVDB(temp_file_paths)
|
|
@@ -349,7 +349,7 @@ def app():
|
|
| 349 |
full_response = ""
|
| 350 |
for response in openai.ChatCompletion.create(
|
| 351 |
model=st.session_state["openai_model"],
|
| 352 |
-
messages=[{"role": m["role"], "content": m["content"][
|
| 353 |
stream=True,
|
| 354 |
):
|
| 355 |
full_response += response.choices[0].delta.get("content", "")
|
|
|
|
| 215 |
tmp.write(added_file.getvalue())
|
| 216 |
tmp_path = tmp.name
|
| 217 |
temp_file_paths.append(tmp_path)
|
| 218 |
+
st.success('Processing file...Done')
|
| 219 |
|
| 220 |
with st.spinner('Constructing vector database from provided materials...'):
|
| 221 |
embeddings_df, faiss_index = constructVDB(temp_file_paths)
|
|
|
|
| 349 |
full_response = ""
|
| 350 |
for response in openai.ChatCompletion.create(
|
| 351 |
model=st.session_state["openai_model"],
|
| 352 |
+
messages=[{"role": m["role"], "content": m["content"][0]} for m in st.session_state.messages],
|
| 353 |
stream=True,
|
| 354 |
):
|
| 355 |
full_response += response.choices[0].delta.get("content", "")
|