Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
|
@@ -46,25 +46,20 @@ custom_html = """
|
|
| 46 |
"""
|
| 47 |
|
| 48 |
# Gradio interface
|
| 49 |
-
|
| 50 |
-
with gr.
|
| 51 |
-
|
| 52 |
-
|
| 53 |
-
|
| 54 |
-
|
| 55 |
-
|
| 56 |
-
gr.HTML(custom_script)
|
| 57 |
-
|
| 58 |
-
# Map the backend function for JavaScript fetch()
|
| 59 |
-
backend_interface = gr.Interface(
|
| 60 |
-
fn=process_data,
|
| 61 |
-
inputs=["text", "number"],
|
| 62 |
-
outputs="text"
|
| 63 |
-
)
|
| 64 |
-
interface.append(backend_interface)
|
| 65 |
-
|
| 66 |
-
return interface
|
| 67 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 68 |
|
| 69 |
# Launch the app
|
| 70 |
-
|
|
|
|
| 46 |
"""
|
| 47 |
|
| 48 |
# Gradio interface
|
| 49 |
+
with gr.Blocks() as app:
|
| 50 |
+
with gr.Row():
|
| 51 |
+
gr.HTML("<h1>Interactive Form Example</h1>")
|
| 52 |
+
with gr.Row():
|
| 53 |
+
gr.HTML(custom_html)
|
| 54 |
+
with gr.Row():
|
| 55 |
+
gr.HTML(custom_script)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 56 |
|
| 57 |
+
# Gradio Interface for the backend function
|
| 58 |
+
interface = gr.Interface(
|
| 59 |
+
fn=process_data,
|
| 60 |
+
inputs=["text", "number"],
|
| 61 |
+
outputs="text"
|
| 62 |
+
)
|
| 63 |
|
| 64 |
# Launch the app
|
| 65 |
+
interface.launch()
|