Spaces:
Paused
Paused
Update app.py
Browse files
app.py
CHANGED
@@ -7,30 +7,6 @@ from transformers import AutoTokenizer, AutoModelForSeq2SeqLM
|
|
7 |
from transformers import pipeline
|
8 |
from langchain.llms import HuggingFacePipeline
|
9 |
|
10 |
-
# Load sample data (a restaurant menu of items)
|
11 |
-
# with open('./data.csv') as file:
|
12 |
-
# lines = csv.reader(file)
|
13 |
-
|
14 |
-
# # Store the name of the menu items in this array. In Chroma, a "document" is a string i.e. name, sentence, paragraph, etc.
|
15 |
-
# documents = []
|
16 |
-
|
17 |
-
# # Store the corresponding menu item IDs in this array.
|
18 |
-
# metadatas = []
|
19 |
-
|
20 |
-
# # Each "document" needs a unique ID. This is like the primary key of a relational database. We'll start at 1 and increment from there.
|
21 |
-
# ids = []
|
22 |
-
# id = 1
|
23 |
-
|
24 |
-
# # Loop thru each line and populate the 3 arrays.
|
25 |
-
# for i, line in enumerate(lines):
|
26 |
-
# if i == 0:
|
27 |
-
# # Skip the first row (the column headers)
|
28 |
-
# continue
|
29 |
-
|
30 |
-
# documents.append(line[0])
|
31 |
-
# metadatas.append({"item_id": line[1]})
|
32 |
-
# ids.append(str(id))
|
33 |
-
# id += 1
|
34 |
|
35 |
# Instantiate chromadb instance. Data is stored on disk (a folder named 'my_vectordb' will be created in the same folder as this file).
|
36 |
chroma_client = chromadb.PersistentClient(path="vector_db")
|
|
|
7 |
from transformers import pipeline
|
8 |
from langchain.llms import HuggingFacePipeline
|
9 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
10 |
|
11 |
# Instantiate chromadb instance. Data is stored on disk (a folder named 'my_vectordb' will be created in the same folder as this file).
|
12 |
chroma_client = chromadb.PersistentClient(path="vector_db")
|