faiz0983 commited on
Commit
28c2469
·
verified ·
1 Parent(s): b2a3594

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -1
app.py CHANGED
@@ -66,7 +66,7 @@ def process_files(files, response_length):
66
  try:
67
  docs = []
68
  for f in files:
69
- docs.extend(load_any(f.path)) # HF SAFE
70
 
71
  splitter = RecursiveCharacterTextSplitter(
72
  chunk_size=800,
@@ -114,9 +114,11 @@ def process_files(files, response_length):
114
  return chain, "✅ Chatbot built successfully"
115
 
116
  except Exception as e:
 
117
  traceback.print_exc()
118
  return None, f"❌ {repr(e)}"
119
 
 
120
  # ---------------- CHAT ----------------
121
  def chat_function(message, history, chain):
122
  if chain is None:
 
66
  try:
67
  docs = []
68
  for f in files:
69
+ docs.extend(load_any(str(f))) # 🔥 THIS IS THE FIX
70
 
71
  splitter = RecursiveCharacterTextSplitter(
72
  chunk_size=800,
 
114
  return chain, "✅ Chatbot built successfully"
115
 
116
  except Exception as e:
117
+ import traceback
118
  traceback.print_exc()
119
  return None, f"❌ {repr(e)}"
120
 
121
+
122
  # ---------------- CHAT ----------------
123
  def chat_function(message, history, chain):
124
  if chain is None: