Spaces:
Sleeping
Sleeping
Commit
·
0bad806
1
Parent(s):
b04ff52
Fix bug in objects list
Browse files- .gitignore +2 -1
- 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(
|
| 79 |
-
|
| 80 |
-
|
| 81 |
-
|
| 82 |
-
|
| 83 |
-
|
| 84 |
-
|
| 85 |
-
|
| 86 |
-
|
| 87 |
-
|
| 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):
|