John6666 commited on
Commit
b5ef806
·
verified ·
1 Parent(s): dc37811

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +34 -34
app.py CHANGED
@@ -1,34 +1,34 @@
1
- import gradio as gr
2
- from t2i_space import get_t2i_space_contents
3
-
4
- css = """"""
5
-
6
- with gr.Blocks(theme="NoCrypt/miku@>=1.2.2", css=css) as demo:
7
- gr.Markdown("# Gradio Demo Space creation helper")
8
- gr.Markdown(
9
- f"""
10
- **The steps are the following**:
11
- - Input model Repo ID which you want to use. e.g. 'user/model'.
12
- - Click "Submit" and download generated README.md and app.py.
13
- - [Create your new Gradio space](https://huggingface.co/new-space) with blank.
14
- - Upload README.md and app.py to your space.
15
- - If you got 500 / 504 error, it happens often, just restart space.
16
- - If it does not work no matter how many times you try, there is often a problem with the settings of the original repo itself, or there is no generation function.
17
- """
18
- )
19
- with gr.Column():
20
- repo_id = gr.Textbox(label="Model repo ID", placeholder="username/modelname", value="", max_lines=1)
21
- with gr.Row():
22
- gradio_version = gr.Textbox(label="Gradio version", placeholder="username/modelname", value="5.7.0", max_lines=1)
23
- private_ok = gr.Checkbox(label="Allow private repo", value=True)
24
- run_button = gr.Button(value="Submit")
25
- space_file = gr.Files(label="Output", interactive=False)
26
-
27
- gr.on(
28
- triggers=[repo_id.submit, run_button.click],
29
- fn=get_t2i_space_contents,
30
- inputs=[repo_id, gradio_version, private_ok],
31
- outputs=[space_file],
32
- )
33
-
34
- demo.queue().launch(ssr_mode=False)
 
1
+ import gradio as gr
2
+ from t2i_space import get_t2i_space_contents
3
+
4
+ css = """"""
5
+
6
+ with gr.Blocks(theme="NoCrypt/miku@>=1.2.2", css=css) as demo:
7
+ gr.Markdown("# Gradio Demo Space creation helper")
8
+ gr.Markdown(
9
+ f"""
10
+ **The steps are the following**:
11
+ - Input model Repo ID which you want to use. e.g. 'user/model'.
12
+ - Click "Submit" and download generated README.md and app.py.
13
+ - [Create your new Gradio space](https://huggingface.co/new-space) with blank.
14
+ - Upload README.md and app.py to your space.
15
+ - If you got 500 / 504 error, it happens often, just restart space.
16
+ - If it does not work no matter how many times you try, there is often a problem with the settings of the original repo itself, or there is no generation function.
17
+ """
18
+ )
19
+ with gr.Column():
20
+ repo_id = gr.Textbox(label="Model repo ID", placeholder="username/modelname", value="", max_lines=1)
21
+ with gr.Row():
22
+ gradio_version = gr.Textbox(label="Gradio version", placeholder="username/modelname", value="5.11.0", max_lines=1)
23
+ private_ok = gr.Checkbox(label="Allow private repo", value=True)
24
+ run_button = gr.Button(value="Submit")
25
+ space_file = gr.Files(label="Output", interactive=False)
26
+
27
+ gr.on(
28
+ triggers=[repo_id.submit, run_button.click],
29
+ fn=get_t2i_space_contents,
30
+ inputs=[repo_id, gradio_version, private_ok],
31
+ outputs=[space_file],
32
+ )
33
+
34
+ demo.queue().launch(ssr_mode=False)