Hidayatmahar commited on
Commit
10b1cc2
·
verified ·
1 Parent(s): ca32445

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -6,14 +6,14 @@ import numpy as np
6
  from datasets import load_dataset
7
 
8
  # Step 1: Get the Pinecone API key from the environment variable (Hugging Face secret)
9
- pinecone_api_key = os.getenv('PINECONE_API_KEY') # Fetch Pinecone API key from Hugging Face secrets
10
 
11
  if not pinecone_api_key:
12
  st.error("Pinecone API key not found! Make sure to set the secret in Hugging Face settings.")
13
  st.stop()
14
 
15
  # Initialize Pinecone client using the API key
16
- pinecone.init(api_key=pinecone_api_key, environment="us-west1-gcp") # Change the environment if needed
17
 
18
  # Connect to your Pinecone index
19
  index_name = "legal-docs-index-dji2ip8" # Your Pinecone index name
 
6
  from datasets import load_dataset
7
 
8
  # Step 1: Get the Pinecone API key from the environment variable (Hugging Face secret)
9
+ pinecone_api_key = st.secrets('PINECONE_API_KEY') # Fetch Pinecone API key from Hugging Face secrets
10
 
11
  if not pinecone_api_key:
12
  st.error("Pinecone API key not found! Make sure to set the secret in Hugging Face settings.")
13
  st.stop()
14
 
15
  # Initialize Pinecone client using the API key
16
+ pinecone.init(api_key=pinecone_api_key, environment="us-esst-1") # Change the environment if needed
17
 
18
  # Connect to your Pinecone index
19
  index_name = "legal-docs-index-dji2ip8" # Your Pinecone index name