Spaces:
Build error
Build error
Upload app.py
Browse files
app.py
CHANGED
@@ -155,7 +155,7 @@ decoder_model = st.selectbox("Select Decoder Model", decoder_models_choice)
|
|
155 |
if encoder_model == "MPNET":
|
156 |
# Connect to pinecone environment
|
157 |
pinecone.init(
|
158 |
-
api_key="
|
159 |
)
|
160 |
pinecone_index_name = "week2-all-mpnet-base"
|
161 |
pinecone_index = pinecone.Index(pinecone_index_name)
|
@@ -164,7 +164,7 @@ if encoder_model == "MPNET":
|
|
164 |
elif encoder_model == "SGPT":
|
165 |
# Connect to pinecone environment
|
166 |
pinecone.init(
|
167 |
-
api_key="
|
168 |
)
|
169 |
pinecone_index_name = "week2-sgpt-125m"
|
170 |
pinecone_index = pinecone.Index(pinecone_index_name)
|
@@ -197,7 +197,7 @@ st.subheader("Answer:")
|
|
197 |
if decoder_model == "GPT3 (summary_davinci)":
|
198 |
openai_key = st.text_input(
|
199 |
"Enter OpenAI key",
|
200 |
-
value="
|
201 |
type="password",
|
202 |
)
|
203 |
api_key = save_key(openai_key)
|
@@ -211,7 +211,7 @@ if decoder_model == "GPT3 (summary_davinci)":
|
|
211 |
elif decoder_model == "GPT3 (QA_davinci)":
|
212 |
openai_key = st.text_input(
|
213 |
"Enter OpenAI key",
|
214 |
-
value="
|
215 |
type="password",
|
216 |
)
|
217 |
api_key = save_key(openai_key)
|
|
|
155 |
if encoder_model == "MPNET":
|
156 |
# Connect to pinecone environment
|
157 |
pinecone.init(
|
158 |
+
api_key=st.secrets["pinecone_mpnet"], environment="us-east1-gcp"
|
159 |
)
|
160 |
pinecone_index_name = "week2-all-mpnet-base"
|
161 |
pinecone_index = pinecone.Index(pinecone_index_name)
|
|
|
164 |
elif encoder_model == "SGPT":
|
165 |
# Connect to pinecone environment
|
166 |
pinecone.init(
|
167 |
+
api_key=st.secrets["pinecone_sgpt"], environment="us-east1-gcp"
|
168 |
)
|
169 |
pinecone_index_name = "week2-sgpt-125m"
|
170 |
pinecone_index = pinecone.Index(pinecone_index_name)
|
|
|
197 |
if decoder_model == "GPT3 (summary_davinci)":
|
198 |
openai_key = st.text_input(
|
199 |
"Enter OpenAI key",
|
200 |
+
value=st.secrets["openai_key"],
|
201 |
type="password",
|
202 |
)
|
203 |
api_key = save_key(openai_key)
|
|
|
211 |
elif decoder_model == "GPT3 (QA_davinci)":
|
212 |
openai_key = st.text_input(
|
213 |
"Enter OpenAI key",
|
214 |
+
value=st.secrets["openai_key"],
|
215 |
type="password",
|
216 |
)
|
217 |
api_key = save_key(openai_key)
|