likhonsheikh commited on
Commit
6fd3027
·
verified ·
1 Parent(s): d586109

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +10 -19
app.py CHANGED
@@ -1,24 +1,15 @@
1
  import gradio as gr
2
- from executor import CodeExecutor
3
 
4
- executor = CodeExecutor()
 
5
 
6
- def run_tool(code, inputs="", packages=""):
7
- result = executor.execute(
8
- code=code,
9
- inputs=inputs.split(",") if inputs else [],
10
- packages=packages
11
- )
12
- return result
13
-
14
- iface = gr.Interface(
15
- fn=run_tool,
16
- inputs=[
17
- gr.Textbox(label="Python Code", lines=10, placeholder="print('Hello')"),
18
- gr.Textbox(label="Inputs (comma-separated)", placeholder="10,20"),
19
- gr.Textbox(label="Packages (comma-separated)", placeholder="numpy,requests"),
20
- ],
21
- outputs=gr.Textbox(label="Output")
22
  )
23
 
24
- iface.launch()
 
 
1
  import gradio as gr
 
2
 
3
+ def greet(name: str) -> str:
4
+ return f"👋 Hello, {name}! Welcome to Likhon's AI Interpreter Space."
5
 
6
+ demo = gr.Interface(
7
+ fn=greet,
8
+ inputs=gr.Textbox(lines=1, placeholder="Enter your name", label="Name"),
9
+ outputs=gr.Textbox(label="Greeting"),
10
+ title="💡 Likhon's AI Tool",
11
+ description="A simple greeting tool using Gradio in Dockerized Hugging Face Space."
 
 
 
 
 
 
 
 
 
 
12
  )
13
 
14
+ if __name__ == "__main__":
15
+ demo.launch(server_name="0.0.0.0", server_port=7860)