Wauplin HF staff commited on
Commit
078b7be
2 Parent(s): fd92af7 ae220b3

Merge branch 'main' of hf.co:spaces/Wauplin/gradio-space-ci

Browse files
Files changed (3) hide show
  1. README.md +1 -1
  2. app.py +2 -18
  3. requirements.txt +1 -1
README.md CHANGED
@@ -42,7 +42,7 @@ Add the following line to it:
42
 
43
  ```bash
44
  # requirements.txt
45
- git+https://huggingface.co/spaces/Wauplin/gradio-space-ci
46
  ```
47
 
48
 
 
42
 
43
  ```bash
44
  # requirements.txt
45
+ gradio-space-ci@git+https://huggingface.co/spaces/Wauplin/gradio-space-ci
46
  ```
47
 
48
 
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("## Dummy gradio app to showcase gradio-space-ci")
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=demo_with_readme.queue(), # ANY gradio app
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]`.
requirements.txt CHANGED
@@ -1,2 +1,2 @@
1
  gradio
2
- git+https://huggingface.co/spaces/Wauplin/gradio-space-ci
 
1
  gradio
2
+ gradio-space-ci@git+https://huggingface.co/spaces/Wauplin/gradio-space-ci