xfu314 commited on
Commit
b8e6904
·
1 Parent(s): bea8d53

error edit

Browse files
Files changed (2) hide show
  1. app.py +7 -2
  2. requirements.txt +0 -2
app.py CHANGED
@@ -1,9 +1,14 @@
1
  import gradio as gr
2
  import spaces
3
 
 
4
  def greet(name):
5
  return "Hello " + name + "!!"
6
 
7
- demo = gr.Interface(fn=greet, inputs="text", outputs="text")
8
- print("Launching the Gradio demo...")
 
 
 
 
9
  demo.launch()
 
1
  import gradio as gr
2
  import spaces
3
 
4
+ @spaces.GPU
5
  def greet(name):
6
  return "Hello " + name + "!!"
7
 
8
+ # 确保是这样写的
9
+ with gr.Blocks() as demo:
10
+ # ... 你的组件 ...
11
+ pass
12
+
13
+ # 不要加 server_name 或 server_port,直接 launch
14
  demo.launch()
requirements.txt CHANGED
@@ -1,2 +0,0 @@
1
- gradio==5.12.0
2
- spaces