tang-x commited on
Commit
8b856a4
β€’
1 Parent(s): 0627bec

Create app.py

Browse files
Files changed (1) hide show
  1. app.py +27 -0
app.py ADDED
@@ -0,0 +1,27 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import gradio as gr
2
+ import os
3
+ from dotenv import load_dotenv
4
+
5
+ # εŠ θ½½ηŽ―ε’ƒε˜ι‡
6
+ load_dotenv()
7
+
8
+ def start_web_service():
9
+ # θΏ™ι‡Œζ·»εŠ ε―εŠ¨ Web ζœεŠ‘ηš„ι€»θΎ‘
10
+ # ε―θƒ½ιœ€θ¦θ°ƒη”¨εŽŸι•œεƒηš„ε―εŠ¨ζ–Ήζ³•
11
+ pass
12
+
13
+ # εˆ›ε»Ί Gradio ζŽ₯口
14
+ def create_interface():
15
+ iface = gr.Interface(
16
+ fn=start_web_service,
17
+ inputs=None,
18
+ outputs=gr.Textbox(label="ζœεŠ‘ηŠΆζ€"),
19
+ title="Long Novel GPT",
20
+ description="ι•Ώζ–‡ζœ¬η”ŸζˆζœεŠ‘"
21
+ )
22
+ return iface
23
+
24
+ # 启动服劑
25
+ if __name__ == "__main__":
26
+ interface = create_interface()
27
+ interface.launch(server_name="0.0.0.0", server_port=7860)