Adityadn commited on
Commit
5736297
·
verified ·
1 Parent(s): 2f1b79c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +13 -5
app.py CHANGED
@@ -1,8 +1,16 @@
1
  from gradio_client import Client
2
 
3
- client = Client("Adityadn/Test")
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
 
3
+ def Prediction():
4
+ client = Client("Adityadn/Test")
5
+ result = client.predict(
6
+ text, # str in 'text' Textbox component
7
+ api_name="/predict"
8
+ )
9
+
10
+ iface = gr.Interface(
11
+ fn=Prediction,
12
+ inputs=gr.Textbox(show_copy_button=True), # Menggunakan input textbox
13
+ outputs=gr.Textbox(type="text",show_copy_button=True) # Menetapkan output ke tipe teks
14
  )
15
+
16
+ iface.launch(show_api=False)