Cyantist8208 commited on
Commit
185a5dd
·
1 Parent(s): f0f729a
Files changed (1) hide show
  1. app.py +3 -11
app.py CHANGED
@@ -1,16 +1,8 @@
1
  import gradio as gr
2
 
3
- # 定義模型的預測函數
4
  def generate_reply(prompt):
5
- # 在這裡進行模型推論,例如使用 GPT 或其他模型
6
- return f"這是回覆:{prompt}"
7
 
8
- # 使用 Gradio 創建介面,並設置 fn 來處理請求
9
- interface = gr.Interface(
10
- fn=generate_reply, # 使用你的推論函數
11
- inputs="text", # 輸入類型為文字
12
- outputs="text", # 輸出類型為文字
13
- )
14
 
15
- # 啟動 Gradio 介面,讓它處理 API 請求
16
- interface.launch(share=True)
 
1
  import gradio as gr
2
 
 
3
  def generate_reply(prompt):
4
+ return "您好!這是針對您輸入的回覆:" + prompt
 
5
 
6
+ demo = gr.Interface(fn=generate_reply, inputs="text", outputs="text")
 
 
 
 
 
7
 
8
+ demo.launch()