Nuno-Tome commited on
Commit
6c7a215
β€’
1 Parent(s): 34eb043
Files changed (2) hide show
  1. app.py +10 -4
  2. requirements.txt +2 -1
app.py CHANGED
@@ -1,8 +1,14 @@
1
  from gradio_client import Client
 
2
 
3
  client = Client("Nuno-Tome/API_demo_server")
4
- result = client.predict(
5
- "Hello!!", # str in 'text' Textbox component
 
 
6
  api_name="/predict"
7
- )
8
- print(result)
 
 
 
 
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
+
14
+ io = gr.Interface(request, "textbox", "json")
requirements.txt CHANGED
@@ -1 +1,2 @@
1
- gradio_client
 
 
1
+ gradio_client
2
+ gradio