Spaces:
Sleeping
Sleeping
File size: 1,501 Bytes
024edca b8c8e0a 024edca b8c8e0a 024edca |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 |
import gradio as gr
from mysite.utilities import chat_with_interpreter, completion, process_file
def setup_gradio_interfaces():
chat_interface = gr.ChatInterface(
fn=chat_with_interpreter,
examples=["サンプルHTMLの作成", "google spreadの読み込み作成", "merhaba"],
title="Auto Program",
css=".chat-container { height: 1500px; }",
)
chat_interface2 = gr.ChatInterface(
fn=chat_with_interpreter,
examples=["こんにちは", "どうしたの?"],
title="Auto Program 2",
)
chat_interface2.queue()
demo4 = gr.ChatInterface(
chat_with_interpreter,
additional_inputs=[
gr.Textbox(value="You are a friendly Chatbot.", label="System message"),
gr.Slider(minimum=1, maximum=2048, value=512, step=1, label="Max new tokens"),
gr.Slider(minimum=0.1, maximum=4.0, value=0.7, step=0.1, label="Temperature"),
gr.Slider(minimum=0.1, maximum=1.0, value=0.95, step=0.05, label="Top-p (nucleus sampling)"),
],
)
democs = gr.Interface(
fn=process_file,
inputs=[
"file",
gr.Textbox(label="Additional Notes", lines=10),
gr.Textbox(label="Folder Name"),
],
outputs="text",
)
default_interfaces = [demo4,democs]
default_names = ["demo4","仕様書から作成"]
tabs = gr.TabbedInterface(default_interfaces, default_names)
tabs.queue()
return tabs
|