Spaces:
Paused
Paused
Update app.py
Browse files
app.py
CHANGED
|
@@ -20,7 +20,7 @@ from stability_sdk import client
|
|
| 20 |
import stability_sdk.interfaces.gooseai.generation.generation_pb2 as generation
|
| 21 |
|
| 22 |
stability_api = client.StabilityInference(
|
| 23 |
-
key=os.environ("STABILITY_KEY"),
|
| 24 |
# key=os.environ['STABILITY_KEY'], # API Key reference.
|
| 25 |
verbose=True, # Print debug messages.
|
| 26 |
engine="stable-diffusion-v1-5", # Set the engine to use for generation.
|
|
@@ -36,7 +36,7 @@ def search_internet(question):
|
|
| 36 |
"gl": "in",
|
| 37 |
"google_domain": "google.co.in",
|
| 38 |
# "api_key": ""
|
| 39 |
-
"api_key": os.environ("GOOGLE_API") #os.environ['GOOGLE_API']
|
| 40 |
}
|
| 41 |
|
| 42 |
params = {
|
|
@@ -46,7 +46,7 @@ def search_internet(question):
|
|
| 46 |
"gl": "in",
|
| 47 |
"google_domain": "google.co.in",
|
| 48 |
# "api_key": ""
|
| 49 |
-
"api_key": os.environ("GOOGLE_API") #os.environ['GOOGLE_API']
|
| 50 |
}
|
| 51 |
|
| 52 |
search = GoogleSearch(params)
|
|
@@ -77,7 +77,7 @@ def search_internet(question):
|
|
| 77 |
st.write(snippets)
|
| 78 |
|
| 79 |
# openai.api_key = ""
|
| 80 |
-
openai.api_key = os.environ("OPENAI_KEY") #os.environ['OPENAI_KEY']
|
| 81 |
|
| 82 |
def openai_response(PROMPT):
|
| 83 |
response = openai.Image.create(
|
|
|
|
| 20 |
import stability_sdk.interfaces.gooseai.generation.generation_pb2 as generation
|
| 21 |
|
| 22 |
stability_api = client.StabilityInference(
|
| 23 |
+
key=st.secrets["STABILITY_KEY"] #os.environ("STABILITY_KEY"),
|
| 24 |
# key=os.environ['STABILITY_KEY'], # API Key reference.
|
| 25 |
verbose=True, # Print debug messages.
|
| 26 |
engine="stable-diffusion-v1-5", # Set the engine to use for generation.
|
|
|
|
| 36 |
"gl": "in",
|
| 37 |
"google_domain": "google.co.in",
|
| 38 |
# "api_key": ""
|
| 39 |
+
"api_key": st.secrets["GOOGLE_API"] #os.environ("GOOGLE_API") #os.environ['GOOGLE_API']
|
| 40 |
}
|
| 41 |
|
| 42 |
params = {
|
|
|
|
| 46 |
"gl": "in",
|
| 47 |
"google_domain": "google.co.in",
|
| 48 |
# "api_key": ""
|
| 49 |
+
"api_key": st.secrets["GOOGLE_API"] #os.environ("GOOGLE_API") #os.environ['GOOGLE_API']
|
| 50 |
}
|
| 51 |
|
| 52 |
search = GoogleSearch(params)
|
|
|
|
| 77 |
st.write(snippets)
|
| 78 |
|
| 79 |
# openai.api_key = ""
|
| 80 |
+
openai.api_key = st.secrets["OPENAI_KEY"] #os.environ("OPENAI_KEY") #os.environ['OPENAI_KEY']
|
| 81 |
|
| 82 |
def openai_response(PROMPT):
|
| 83 |
response = openai.Image.create(
|