Spaces:
Runtime error
Runtime error
Update app.py (#1)
Browse files- Update app.py (adaed782bc2f6f99eacc2e71dcb576e45366164e)
app.py
CHANGED
|
@@ -4,28 +4,12 @@ from pathlib import Path
|
|
| 4 |
import gradio as gr
|
| 5 |
from gradio_space_ci import configure_space_ci
|
| 6 |
|
| 7 |
-
|
| 8 |
-
def greet(name: str) -> str:
|
| 9 |
-
return "Hello " + name + "!"
|
| 10 |
-
|
| 11 |
-
|
| 12 |
with gr.Blocks() as demo:
|
| 13 |
-
gr.Markdown("
|
| 14 |
-
name = gr.Textbox(label="Name")
|
| 15 |
-
output = gr.Textbox(label="Output Box")
|
| 16 |
-
greet_btn = gr.Button("Greet")
|
| 17 |
-
greet_btn.click(fn=greet, inputs=name, outputs=output, api_name="greet")
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
with gr.Blocks() as demo_with_readme:
|
| 21 |
-
with gr.Tab("README"):
|
| 22 |
-
gr.Markdown(Path("README.md").read_text().split("---")[-1])
|
| 23 |
-
with gr.Tab("Demo"):
|
| 24 |
-
demo.render()
|
| 25 |
|
| 26 |
if __name__ == "__main__":
|
| 27 |
configure_space_ci(
|
| 28 |
-
blocks=
|
| 29 |
trusted_authors=["clefourrier"], # space owners + manually trusted authors
|
| 30 |
private="auto", # ephemeral spaces will have same visibility as the main space. Otherwise, set to `True` or `False` explicitly.
|
| 31 |
variables="auto", # same variables as the main space. Otherwise, set to a `Dict[str, str]`.
|
|
|
|
| 4 |
import gradio as gr
|
| 5 |
from gradio_space_ci import configure_space_ci
|
| 6 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 7 |
with gr.Blocks() as demo:
|
| 8 |
+
gr.Markdown(Path("README.md").read_text().split("---")[-1])
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 9 |
|
| 10 |
if __name__ == "__main__":
|
| 11 |
configure_space_ci(
|
| 12 |
+
blocks=demo, # ANY gradio app
|
| 13 |
trusted_authors=["clefourrier"], # space owners + manually trusted authors
|
| 14 |
private="auto", # ephemeral spaces will have same visibility as the main space. Otherwise, set to `True` or `False` explicitly.
|
| 15 |
variables="auto", # same variables as the main space. Otherwise, set to a `Dict[str, str]`.
|