ionosphere commited on
Commit
0bad806
·
1 Parent(s): b04ff52

Fix bug in objects list

Browse files
Files changed (2) hide show
  1. .gitignore +2 -1
  2. app.py +12 -11
.gitignore CHANGED
@@ -1,3 +1,4 @@
1
  chroma_db/*
2
  __pycache__/*
3
- .venv
 
 
1
  chroma_db/*
2
  __pycache__/*
3
+ .venv
4
+ .env
app.py CHANGED
@@ -75,17 +75,18 @@ def empty_db():
75
  return get_documents_in_db()
76
 
77
 
78
- def load_file(file):
79
- documents = loader.load_data(file=file)
80
-
81
- for doc in documents:
82
- index.insert(doc)
83
-
84
- return (
85
- gr.Textbox(visible=False),
86
- gr.Textbox(value=f"Document encoded ! You can ask questions", visible=True),
87
- get_documents_in_db(),
88
- )
 
89
 
90
 
91
  def load_document(input_file):
 
75
  return get_documents_in_db()
76
 
77
 
78
+ def load_file(files):
79
+ for file in files:
80
+ documents = loader.load_data(file=file)
81
+
82
+ for doc in documents:
83
+ index.insert(doc)
84
+
85
+ return (
86
+ gr.Textbox(visible=False),
87
+ gr.Textbox(value=f"Document encoded ! You can ask questions", visible=True),
88
+ get_documents_in_db(),
89
+ )
90
 
91
 
92
  def load_document(input_file):