medipro / app1.py
leolaish's picture
Create app1.py
f0cec25 verified
raw
history blame
938 Bytes
import gradio as gr
from huggingface_hub import InferenceClient
client = InferenceClient("HuggingFaceH4/zephyr-7b-beta")
def respond(message, history, system_message, max_tokens, temperature, top_p):
# ... (same as before)
def clear_history():
return [], "" # Return empty history and message
demo = gr.ChatInterface(
respond,
title="MediPro",
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="MediPro"),
],
container=gr.Container(
gr.ChatHistory(id="chat-history"),
gr.Button("New Chat", id="new-chat-button", onclick=clear_history),
),
)
if __name__ == "__main__":
demo.launch()