Milanmor commited on
Commit
3f8c3b6
·
1 Parent(s): f2c987f

Initial commit: Gradio app scaffold with venv setup

Browse files
Files changed (3) hide show
  1. .gitignore +19 -0
  2. app.py +26 -0
  3. requirements.txt +1 -0
.gitignore ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Python
2
+ __pycache__/
3
+ *.pyc
4
+ *.pyo
5
+ *.pyd
6
+
7
+ # Virtual environments
8
+ .venv/
9
+ venv/
10
+ ENV/
11
+
12
+ # Envs
13
+ .env
14
+ .env.*
15
+
16
+ # OS / Editor
17
+ .DS_Store
18
+ .idea/
19
+ .vscode/
app.py ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import gradio as gr
2
+
3
+ TITLE = "MPlato"
4
+ DESCRIPTION = "Minimal Gradio app scaffold for the Hugging Face Space. Replace the logic with your own."
5
+
6
+
7
+ def echo(text: str) -> str:
8
+ return text or ""
9
+
10
+
11
+ with gr.Blocks(title=TITLE, theme="soft") as demo:
12
+ gr.Markdown(f"# {TITLE}\n{DESCRIPTION}")
13
+ with gr.Row():
14
+ inp = gr.Textbox(label="Input", placeholder="Type something…")
15
+ with gr.Row():
16
+ out = gr.Textbox(label="Output", interactive=False)
17
+ with gr.Row():
18
+ btn = gr.Button("Echo")
19
+
20
+ btn.click(echo, inp, out)
21
+ inp.submit(echo, inp, out)
22
+
23
+
24
+ if __name__ == "__main__":
25
+ # On Spaces, launch is handled automatically; this is for local runs
26
+ demo.launch()
requirements.txt ADDED
@@ -0,0 +1 @@
 
 
1
+ gradio>=4.44.1