acpotts commited on
Commit
5feaab0
·
verified ·
1 Parent(s): 76b7bdd

multiple files option

Browse files
Files changed (1) hide show
  1. app.py +12 -12
app.py CHANGED
@@ -90,22 +90,22 @@ async def on_chat_start():
90
  max_files=10
91
  ).send()
92
 
93
- file = files[0]
94
 
95
- msg = cl.Message(
96
- content=f"Processing `{file.name}`...", disable_human_feedback=True
97
- )
98
- await msg.send()
99
 
100
- # load the file
101
- texts = process_text_file(file)
102
 
103
- print(f"Processing {len(texts)} text chunks")
104
 
105
- # Create a dict vector store
106
- vector_db = VectorDatabase()
107
- vector_db = await vector_db.abuild_from_list(texts)
108
-
109
  chat_openai = ChatOpenAI()
110
 
111
  # Create a chain
 
90
  max_files=10
91
  ).send()
92
 
93
+ for file in files:
94
 
95
+ msg = cl.Message(
96
+ content=f"Processing `{file.name}`...", disable_human_feedback=True
97
+ )
98
+ await msg.send()
99
 
100
+ # load the file
101
+ texts = process_text_file(file)
102
 
103
+ print(f"Processing {len(texts)} text chunks")
104
 
105
+ # Create a dict vector store
106
+ vector_db = VectorDatabase()
107
+ vector_db = await vector_db.abuild_from_list(texts)
108
+
109
  chat_openai = ChatOpenAI()
110
 
111
  # Create a chain