codemichaeld commited on
Commit
7b0f049
·
verified ·
1 Parent(s): d748af6

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +11 -4
app.py CHANGED
@@ -1,15 +1,22 @@
1
  import gradio as gr
2
  import spaces
3
 
4
- # Add this directly below your imports at top-level scope
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 follows...
11
  def say_hello(name: str) -> str:
12
  return f"Hello {name}!"
13
 
14
- demo = gr.Interface(fn=say_hello, inputs="text", outputs="text")
15
- demo.launch()
 
 
 
 
 
 
 
 
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)