robertselvam commited on
Commit
0ba93c6
1 Parent(s): 8155afc

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -5
app.py CHANGED
@@ -96,9 +96,10 @@ class DocumentQA:
96
  Raises:
97
  ValueError: If an error occurs during the process.
98
  """
99
- webpage_text =''
100
- for url in urls.split(','):
101
- webpage_text += self.get_content_from_url(url)
 
102
 
103
  knowledge_base = self.create_knowledge_base(webpage_text)
104
 
@@ -154,13 +155,13 @@ class DocumentQA:
154
 
155
 
156
  file_paths = [single_file_path.name for single_file_path in file_paths]
157
- docs =''
158
  for file_obj in file_paths:
159
 
160
  loader = UnstructuredFileLoader(file_obj, strategy="fast")
161
 
162
  # Load the contents of the file using the loader
163
- docs +=loader.load()
164
 
165
  # Create a knowledge base from the loaded documents using the create_knowledge_base() method
166
  knowledge_base = self.create_knowledge_base(docs)
 
96
  Raises:
97
  ValueError: If an error occurs during the process.
98
  """
99
+ webpage_text =[]
100
+ for url in urls.split(','):
101
+
102
+ webpage_text.extend(self.get_content_from_url(url))
103
 
104
  knowledge_base = self.create_knowledge_base(webpage_text)
105
 
 
155
 
156
 
157
  file_paths = [single_file_path.name for single_file_path in file_paths]
158
+ docs =[]
159
  for file_obj in file_paths:
160
 
161
  loader = UnstructuredFileLoader(file_obj, strategy="fast")
162
 
163
  # Load the contents of the file using the loader
164
+ docs.extend(loader.load())
165
 
166
  # Create a knowledge base from the loaded documents using the create_knowledge_base() method
167
  knowledge_base = self.create_knowledge_base(docs)