Spaces:
Running
on
Zero
Running
on
Zero
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 | |