Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -94,8 +94,10 @@ hf_embeddings = HFEmbeddings(api_url, headers)
|
|
94 |
PINECONE_API_KEY = "5f07b52e-2a16-42a3-89c4-8899c584109e"
|
95 |
PINECONE_ENVIRONMENT = "asia-southeast1-gcp-free"
|
96 |
PINECONE_INDEX_NAME = "myindex-allminilm-l6-v2-384"
|
|
|
97 |
|
98 |
index_name = PINECONE_INDEX_NAME
|
|
|
99 |
#namespace = random_string
|
100 |
namespace = "HF-GRADIO-0914"
|
101 |
|
@@ -107,6 +109,8 @@ namespace = "HF-GRADIO-0914"
|
|
107 |
#atexit.register(exit_handler)
|
108 |
|
109 |
pinecone.init(api_key=PINECONE_API_KEY, environment=PINECONE_ENVIRONMENT)
|
|
|
|
|
110 |
vector_db = Pinecone.from_texts(db_texts, hf_embeddings, index_name=index_name, namespace=namespace)
|
111 |
|
112 |
#Considering Python apps automatically execute codes, a Vector-DB should have been created under namespace = "HF-GRADIO-0909"
|
|
|
94 |
PINECONE_API_KEY = "5f07b52e-2a16-42a3-89c4-8899c584109e"
|
95 |
PINECONE_ENVIRONMENT = "asia-southeast1-gcp-free"
|
96 |
PINECONE_INDEX_NAME = "myindex-allminilm-l6-v2-384"
|
97 |
+
print(PINECONE_INDEX_NAME)
|
98 |
|
99 |
index_name = PINECONE_INDEX_NAME
|
100 |
+
print(index_name)
|
101 |
#namespace = random_string
|
102 |
namespace = "HF-GRADIO-0914"
|
103 |
|
|
|
109 |
#atexit.register(exit_handler)
|
110 |
|
111 |
pinecone.init(api_key=PINECONE_API_KEY, environment=PINECONE_ENVIRONMENT)
|
112 |
+
index_name = pinecone.Index(index_name)
|
113 |
+
print(index_name)
|
114 |
vector_db = Pinecone.from_texts(db_texts, hf_embeddings, index_name=index_name, namespace=namespace)
|
115 |
|
116 |
#Considering Python apps automatically execute codes, a Vector-DB should have been created under namespace = "HF-GRADIO-0909"
|