Spaces:
Sleeping
Sleeping
no message
Browse files
app.py
CHANGED
@@ -1,13 +1,21 @@
|
|
1 |
from gradio_client import Client
|
2 |
import gradio as gr
|
3 |
|
|
|
|
|
4 |
client = Client("Nuno-Tome/API_demo_server")
|
5 |
|
6 |
def request(text):
|
|
|
|
|
|
|
7 |
result = client.predict(
|
8 |
-
"Hello World", # str in 'text' Textbox component
|
|
|
9 |
api_name="/predict"
|
10 |
-
)
|
|
|
|
|
11 |
return result
|
12 |
|
13 |
|
|
|
1 |
from gradio_client import Client
|
2 |
import gradio as gr
|
3 |
|
4 |
+
DEBUG_MODE = True
|
5 |
+
|
6 |
client = Client("Nuno-Tome/API_demo_server")
|
7 |
|
8 |
def request(text):
|
9 |
+
if DEBUG_MODE:
|
10 |
+
print(f"Client: {client}")
|
11 |
+
print(f"Requesting prediction for: {text}")
|
12 |
result = client.predict(
|
13 |
+
#"Hello World", # str in 'text' Textbox component
|
14 |
+
text,
|
15 |
api_name="/predict"
|
16 |
+
)
|
17 |
+
if DEBUG_MODE:
|
18 |
+
print(f"Prediction result: {result}")
|
19 |
return result
|
20 |
|
21 |
|