openthaigpt / app.py
Kobkrit Viriyayudhakorn
Add OpenThaiGPT Zero
cfce0d9
raw
history blame
956 Bytes
import gradio as gr
import openthaigpt
demo = gr.Blocks()
def gen(input):
return openthaigpt.generate(input)
def zero(input):
return openthaigpt.zero(input)
with demo:
gr.Markdown("OpenThaiGPT version 0.0.10")
with gr.Tabs():
with gr.TabItem("Generate"):
gr.Interface(fn=gen, inputs=gr.Textbox(lines=3, label="Input Prompt", value="Q: อยากลดความอ้วน ทำอย่างไร\n\nA:"), outputs="text")
with gr.TabItem("Zero (GPT Check)"):
gr.Interface(fn=zero, inputs=gr.Textbox(lines=3, label="Input Text", value="การลดน้ำหนักเป็นเรื่องที่ต้องพิจารณาอย่างละเอียดและรอบคอบเพื่อให้ได้ผลลัพธ์ที่ดีและมีประสิทธิภาพมากที่สุด"), outputs="text")
demo.launch()