Update app.py
Browse files
app.py
CHANGED
@@ -12,17 +12,18 @@ import os
|
|
12 |
import numpy as np
|
13 |
from langchain.vectorstores import Pinecone
|
14 |
from langchain.schema import Document
|
15 |
-
|
16 |
|
17 |
# Initialize Pinecone
|
18 |
-
PINECONE_API_KEY = os.getenv("PINECONE_API_KEY"
|
19 |
PINECONE_INDEX = "arolchatbot" # e.g., "us-west1-gcp-free"
|
20 |
-
|
|
|
21 |
# Connect to Pinecone
|
22 |
|
23 |
|
24 |
embeddings = HuggingFaceEmbeddings(model_name="thenlper/gte-large")
|
25 |
-
vector_store = Pinecone(
|
26 |
|
27 |
# Model and Tokenizer
|
28 |
model_name = "Meldashti/chatbot"
|
|
|
12 |
import numpy as np
|
13 |
from langchain.vectorstores import Pinecone
|
14 |
from langchain.schema import Document
|
15 |
+
from pinecone import Pinecone as PC
|
16 |
|
17 |
# Initialize Pinecone
|
18 |
+
PINECONE_API_KEY = os.getenv("PINECONE_API_KEY")
|
19 |
PINECONE_INDEX = "arolchatbot" # e.g., "us-west1-gcp-free"
|
20 |
+
pc = PC(api_key=PINECONE_API_KEY)
|
21 |
+
index = pc.Index(PINECONE_INDEX)
|
22 |
# Connect to Pinecone
|
23 |
|
24 |
|
25 |
embeddings = HuggingFaceEmbeddings(model_name="thenlper/gte-large")
|
26 |
+
vector_store = Pinecone(index, embeddings.embed_query, "text")
|
27 |
|
28 |
# Model and Tokenizer
|
29 |
model_name = "Meldashti/chatbot"
|