Spaces:
Sleeping
Sleeping
thoristhor
commited on
Commit
•
e817235
1
Parent(s):
5f430d4
Using a chatvectordb pinecone instead of the raw pinecone
Browse files
app.py
CHANGED
@@ -1,15 +1,16 @@
|
|
1 |
import os
|
2 |
from typing import Optional, Tuple
|
3 |
import gradio as gr
|
4 |
-
import
|
5 |
-
|
6 |
|
7 |
-
pinecone
|
|
|
8 |
api_key="PINECONE_API_KEY", # find at app.pinecone.io
|
9 |
environment="PINECONE_ENV" # next to api key in console
|
10 |
)
|
11 |
|
12 |
-
vectorstore =
|
13 |
from query_data import get_chain
|
14 |
from threading import Lock
|
15 |
|
|
|
1 |
import os
|
2 |
from typing import Optional, Tuple
|
3 |
import gradio as gr
|
4 |
+
from langchain.vectorstores import Pinecone
|
5 |
+
|
6 |
|
7 |
+
# initialize pinecone
|
8 |
+
Pinecone.init(
|
9 |
api_key="PINECONE_API_KEY", # find at app.pinecone.io
|
10 |
environment="PINECONE_ENV" # next to api key in console
|
11 |
)
|
12 |
|
13 |
+
vectorstore = Pineconeinecone.from_texts(texts, embeddings, index_name="sethgodin")
|
14 |
from query_data import get_chain
|
15 |
from threading import Lock
|
16 |
|