Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -1,32 +1,32 @@
|
|
1 |
-
import gradio as gr
|
2 |
-
from t2i_space import get_t2i_space_contents
|
3 |
-
|
4 |
-
css = """"""
|
5 |
-
|
6 |
-
with gr.Blocks(theme="
|
7 |
-
gr.Markdown("# Gradio Text-to-Image Demo Space creation helper")
|
8 |
-
gr.Markdown(
|
9 |
-
f"""
|
10 |
-
**The steps are the following**:
|
11 |
-
- Input text-to-image 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 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 |
-
run_button = gr.Button(value="Submit")
|
22 |
-
space_file = gr.Files(label="Output", interactive=False)
|
23 |
-
|
24 |
-
gr.on(
|
25 |
-
triggers=[repo_id.submit, run_button.click],
|
26 |
-
fn=get_t2i_space_contents,
|
27 |
-
inputs=[repo_id],
|
28 |
-
outputs=[space_file],
|
29 |
-
)
|
30 |
-
|
31 |
-
demo.queue()
|
32 |
-
demo.launch()
|
|
|
1 |
+
import gradio as gr
|
2 |
+
from t2i_space import get_t2i_space_contents
|
3 |
+
|
4 |
+
css = """"""
|
5 |
+
|
6 |
+
with gr.Blocks(theme="Nymbo/Nymbo_Theme", css=css) as demo:
|
7 |
+
gr.Markdown("# Gradio Text-to-Image Demo Space creation helper")
|
8 |
+
gr.Markdown(
|
9 |
+
f"""
|
10 |
+
**The steps are the following**:
|
11 |
+
- Input text-to-image 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 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 |
+
run_button = gr.Button(value="Submit")
|
22 |
+
space_file = gr.Files(label="Output", interactive=False)
|
23 |
+
|
24 |
+
gr.on(
|
25 |
+
triggers=[repo_id.submit, run_button.click],
|
26 |
+
fn=get_t2i_space_contents,
|
27 |
+
inputs=[repo_id],
|
28 |
+
outputs=[space_file],
|
29 |
+
)
|
30 |
+
|
31 |
+
demo.queue()
|
32 |
+
demo.launch()
|