novel / app.py
tang-x's picture
Create app.py
8b856a4 verified
raw
history blame
639 Bytes
import gradio as gr
import os
from dotenv import load_dotenv
# εŠ θ½½ηŽ―ε’ƒε˜ι‡
load_dotenv()
def start_web_service():
# θΏ™ι‡Œζ·»εŠ ε―εŠ¨ Web ζœεŠ‘ηš„ι€»θΎ‘
# ε―θƒ½ιœ€θ¦θ°ƒη”¨εŽŸι•œεƒηš„ε―εŠ¨ζ–Ήζ³•
pass
# εˆ›ε»Ί Gradio ζŽ₯口
def create_interface():
iface = gr.Interface(
fn=start_web_service,
inputs=None,
outputs=gr.Textbox(label="ζœεŠ‘ηŠΆζ€"),
title="Long Novel GPT",
description="ι•Ώζ–‡ζœ¬η”ŸζˆζœεŠ‘"
)
return iface
# 启动服劑
if __name__ == "__main__":
interface = create_interface()
interface.launch(server_name="0.0.0.0", server_port=7860)