Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -1,24 +1,15 @@
|
|
1 |
import gradio as gr
|
2 |
-
from executor import CodeExecutor
|
3 |
|
4 |
-
|
|
|
5 |
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
|
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 |
-
|
|
|
|
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)
|