Update app.py
Browse files
app.py
CHANGED
@@ -1,17 +1,18 @@
|
|
1 |
import gradio as gr
|
2 |
from gradio_client import Client
|
3 |
|
4 |
-
def Prediction():
|
5 |
client = Client("Adityadn/Test")
|
6 |
result = client.predict(
|
7 |
-
|
8 |
-
|
9 |
)
|
|
|
10 |
|
11 |
iface = gr.Interface(
|
12 |
fn=Prediction,
|
13 |
-
inputs=gr.Textbox(show_copy_button=True), # Menggunakan input textbox
|
14 |
-
outputs=gr.Textbox(type="text",show_copy_button=True) # Menetapkan output ke tipe teks
|
15 |
)
|
16 |
|
17 |
-
iface.launch(
|
|
|
1 |
import gradio as gr
|
2 |
from gradio_client import Client
|
3 |
|
4 |
+
def Prediction(text):
|
5 |
client = Client("Adityadn/Test")
|
6 |
result = client.predict(
|
7 |
+
text, # Menggunakan teks yang dimasukkan pengguna
|
8 |
+
api_name="/predict"
|
9 |
)
|
10 |
+
return result
|
11 |
|
12 |
iface = gr.Interface(
|
13 |
fn=Prediction,
|
14 |
+
inputs=gr.Textbox(label="Input", placeholder="Enter Text Here", show_copy_button=True), # Menggunakan input textbox dengan label dan tombol salin
|
15 |
+
outputs=gr.Textbox(type="text", label="Output", show_copy_button=True) # Menetapkan output ke tipe teks dengan label
|
16 |
)
|
17 |
|
18 |
+
iface.launch()
|