peter288 commited on
Commit
9e7c033
·
verified ·
1 Parent(s): 05f4e0c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +12 -2
app.py CHANGED
@@ -1,5 +1,15 @@
1
  import gradio as gr
2
 
3
- # 直接加载翻译模型
4
- demo = gr.load("Helsinki-NLP/opus-mt-en-es", src="models")
 
 
 
 
 
 
 
 
 
 
5
  demo.launch()
 
1
  import gradio as gr
2
 
3
+ def simple_greet(name):
4
+ if not name:
5
+ name = "朋友"
6
+ return f"你好, {name}! API调用成功! 🎉"
7
+
8
+ demo = gr.Interface(
9
+ fn=simple_greet,
10
+ inputs=gr.Textbox(label="请输入你的名字"),
11
+ outputs=gr.Textbox(label="问候语"),
12
+ title="我的简单测试应用"
13
+ )
14
+
15
  demo.launch()