Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,15 +1,22 @@
|
|
| 1 |
import gradio as gr
|
| 2 |
import spaces
|
| 3 |
|
| 4 |
-
#
|
| 5 |
@spaces.GPU
|
| 6 |
def fix_startup_check():
|
| 7 |
"""Dummy function to pass HF ZeroGPU boot validation."""
|
| 8 |
return None
|
| 9 |
|
| 10 |
-
# Your actual app code
|
| 11 |
def say_hello(name: str) -> str:
|
| 12 |
return f"Hello {name}!"
|
| 13 |
|
| 14 |
-
demo = gr.Interface(
|
| 15 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
import gradio as gr
|
| 2 |
import spaces
|
| 3 |
|
| 4 |
+
# Dummy function for ZeroGPU boot validation (keep it)
|
| 5 |
@spaces.GPU
|
| 6 |
def fix_startup_check():
|
| 7 |
"""Dummy function to pass HF ZeroGPU boot validation."""
|
| 8 |
return None
|
| 9 |
|
| 10 |
+
# Your actual app code
|
| 11 |
def say_hello(name: str) -> str:
|
| 12 |
return f"Hello {name}!"
|
| 13 |
|
| 14 |
+
demo = gr.Interface(
|
| 15 |
+
fn=say_hello,
|
| 16 |
+
inputs="text",
|
| 17 |
+
outputs="text",
|
| 18 |
+
api_name="say_hello" # explicit endpoint name (optional)
|
| 19 |
+
)
|
| 20 |
+
|
| 21 |
+
# IMPORTANT: bind to 0.0.0.0 so zrok can forward traffic
|
| 22 |
+
demo.launch(server_name="0.0.0.0", server_port=7860)
|