start with a gradio interface
Browse files
app.py
ADDED
@@ -0,0 +1,36 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import gradio as gr
|
2 |
+
|
3 |
+
def process(git_repo_url, space_destination, user_token):
|
4 |
+
return "hello"
|
5 |
+
|
6 |
+
css = """
|
7 |
+
div#col-container{
|
8 |
+
margin: 0 auto;
|
9 |
+
max-width: 720px;
|
10 |
+
}
|
11 |
+
"""
|
12 |
+
|
13 |
+
with gr.Blocks(css=css) as demo:
|
14 |
+
with gr.Column(elem_id="col-container"):
|
15 |
+
git_repo_url = gr.Textbox(
|
16 |
+
label="Git repo to clone"
|
17 |
+
)
|
18 |
+
space_destination = gr.Textbox(
|
19 |
+
label="Space ID"
|
20 |
+
)
|
21 |
+
user_token = gr.Textbox(
|
22 |
+
label="Write permissions token",
|
23 |
+
type="password"
|
24 |
+
)
|
25 |
+
submit_btn = gr.Button("Clone git repo to my space")
|
26 |
+
status = gr.Textbox(
|
27 |
+
label="Status"
|
28 |
+
)
|
29 |
+
|
30 |
+
submit_btn.click(
|
31 |
+
fn=process,
|
32 |
+
inputs=[git_repo_url, space_destination, user_token],
|
33 |
+
outputs=[status]
|
34 |
+
)
|
35 |
+
|
36 |
+
demo.launch()
|