masadonline commited on
Commit
9b67e66
Β·
verified Β·
1 Parent(s): 6bb6c8b

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -5
app.py CHANGED
@@ -188,7 +188,8 @@ def setup_knowledge_base():
188
  all_text += _format_tables_internal(tables) + "\n"
189
 
190
  # Process CSVs
191
- for filename in ["CustomerOrders.csv"]:
 
192
  csv_path = os.path.join(folder_path, filename)
193
  try:
194
  with open(csv_path, newline='', encoding='utf-8') as csvfile:
@@ -199,8 +200,7 @@ def setup_knowledge_base():
199
  except Exception as e:
200
  print(f"❌ Error reading {filename}: {e}")
201
 
202
-
203
- for filename in ["Products.csv"]:
204
  csv_path = os.path.join(folder_path, filename)
205
  try:
206
  with open(csv_path, newline='', encoding='utf-8') as csvfile:
@@ -211,8 +211,6 @@ def setup_knowledge_base():
211
  except Exception as e:
212
  print(f"❌ Error reading {filename}: {e}")
213
 
214
-
215
-
216
  # Tokenization & chunking
217
  tokenizer = AutoTokenizer.from_pretrained('bert-base-uncased')
218
  chunks = chunk_text(all_text, tokenizer)
 
188
  all_text += _format_tables_internal(tables) + "\n"
189
 
190
  # Process CSVs
191
+ # Process CSVs
192
+ for filename in ["CustomerOrders.csv"]:
193
  csv_path = os.path.join(folder_path, filename)
194
  try:
195
  with open(csv_path, newline='', encoding='utf-8') as csvfile:
 
200
  except Exception as e:
201
  print(f"❌ Error reading {filename}: {e}")
202
 
203
+ for filename in ["Products.csv"]:
 
204
  csv_path = os.path.join(folder_path, filename)
205
  try:
206
  with open(csv_path, newline='', encoding='utf-8') as csvfile:
 
211
  except Exception as e:
212
  print(f"❌ Error reading {filename}: {e}")
213
 
 
 
214
  # Tokenization & chunking
215
  tokenizer = AutoTokenizer.from_pretrained('bert-base-uncased')
216
  chunks = chunk_text(all_text, tokenizer)