Spaces:
Sleeping
Sleeping
requirements.txt
Browse filesgradio
requests
app.py
CHANGED
@@ -1,18 +1,18 @@
|
|
1 |
import gradio as gr
|
2 |
import requests
|
3 |
|
4 |
-
def
|
5 |
-
#
|
6 |
url = "https://hello-493710908743.us-central1.run.app"
|
7 |
-
response = requests.
|
8 |
return response.text
|
9 |
|
10 |
# Gradio Interface
|
11 |
iface = gr.Interface(
|
12 |
-
fn=
|
13 |
-
inputs=
|
14 |
-
outputs=
|
15 |
-
title="
|
16 |
)
|
17 |
|
18 |
iface.launch()
|
|
|
1 |
import gradio as gr
|
2 |
import requests
|
3 |
|
4 |
+
def get_message():
|
5 |
+
# API URL (Cloud Run Service URL)
|
6 |
url = "https://hello-493710908743.us-central1.run.app"
|
7 |
+
response = requests.get(url) # GET request
|
8 |
return response.text
|
9 |
|
10 |
# Gradio Interface
|
11 |
iface = gr.Interface(
|
12 |
+
fn=get_message,
|
13 |
+
inputs=None,
|
14 |
+
outputs="text",
|
15 |
+
title="Cloud Run App Integration"
|
16 |
)
|
17 |
|
18 |
iface.launch()
|