portfolio / sandbox.py
kaba777's picture
ryeの導入; gradioのサンプルコードの書き換え
e185ac1
raw
history blame contribute delete
571 Bytes
import gradio as gr
def respond(
message,
history: list[tuple[str, str]],
system_message,
max_tokens,
temperature,
top_p,
):
print(system_message)
return system_message + 'looll'
"""
For information on how to customize the ChatInterface, peruse the gradio docs: https://www.gradio.app/docs/chatinterface
"""
demo = gr.ChatInterface(
respond,
additional_inputs=[
gr.Textbox(value="You are a friendly Chatbot.", label="System message"),
],
)
if __name__ == "__main__":
demo.launch()