Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -13,6 +13,15 @@ from langchain.chains import create_retrieval_chain
|
|
13 |
import os
|
14 |
import markdown2
|
15 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
16 |
# Retrieve API keys from Hugging Face Spaces secrets
|
17 |
openai_api_key = os.environ.get('OPENAI_API_KEY')
|
18 |
groq_api_key = os.environ.get('GROQ_API_KEY')
|
@@ -138,4 +147,4 @@ iface = gr.Interface(
|
|
138 |
)
|
139 |
|
140 |
# Launch the interface
|
141 |
-
iface.launch()
|
|
|
13 |
import os
|
14 |
import markdown2
|
15 |
|
16 |
+
# Retrieve username and password from environment variables
|
17 |
+
username = os.environ.get("USERNAME")
|
18 |
+
password = os.environ.get("PASSWORD")
|
19 |
+
|
20 |
+
# Ensure both username and password are set
|
21 |
+
if not username or not password:
|
22 |
+
raise ValueError("Both USERNAME and PASSWORD must be set in the environment variables.")
|
23 |
+
|
24 |
+
|
25 |
# Retrieve API keys from Hugging Face Spaces secrets
|
26 |
openai_api_key = os.environ.get('OPENAI_API_KEY')
|
27 |
groq_api_key = os.environ.get('GROQ_API_KEY')
|
|
|
147 |
)
|
148 |
|
149 |
# Launch the interface
|
150 |
+
iface.launch(auth=(username, password))
|