Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -4,24 +4,25 @@ import openai
|
|
4 |
import os
|
5 |
#trying so when user puts la or los angles specific pic comes:
|
6 |
|
7 |
-
|
8 |
-
PICTURE_URL = "
|
9 |
|
10 |
def respond(user_input):
|
11 |
if "los angeles" in user_input.lower() or "la" in user_input.lower():
|
12 |
-
|
13 |
else:
|
14 |
-
|
15 |
-
#Define the Gradio interface#
|
16 |
-
iface = gr.Interface()
|
17 |
|
18 |
-
|
19 |
-
|
20 |
-
|
|
|
|
|
|
|
21 |
|
|
|
|
|
22 |
|
23 |
-
#Launch the interface#
|
24 |
-
iface.launch()#
|
25 |
os.environ["TOKENIZERS_PARALLELISM"] = "false"
|
26 |
|
27 |
# Initialize paths and model identifiers for easy configuration and maintenance
|
|
|
4 |
import os
|
5 |
#trying so when user puts la or los angles specific pic comes:
|
6 |
|
7 |
+
# URL or path to your image file
|
8 |
+
PICTURE_URL = "Stars/sf.png"
|
9 |
|
10 |
def respond(user_input):
|
11 |
if "los angeles" in user_input.lower() or "la" in user_input.lower():
|
12 |
+
return f"Here's a picture of Los Angeles!", PICTURE_URL
|
13 |
else:
|
14 |
+
return "How can I help you with astronomy?", None
|
|
|
|
|
15 |
|
16 |
+
# Define the Gradio interface
|
17 |
+
iface = gr.Interface(
|
18 |
+
fn=respond,
|
19 |
+
inputs="text",
|
20 |
+
outputs=["text", "image"]
|
21 |
+
)
|
22 |
|
23 |
+
# Launch the interface
|
24 |
+
iface.launch()
|
25 |
|
|
|
|
|
26 |
os.environ["TOKENIZERS_PARALLELISM"] = "false"
|
27 |
|
28 |
# Initialize paths and model identifiers for easy configuration and maintenance
|