Spaces:
Build error
Build error
SHAMIL SHAHBAZ AWAN commited on
Update app.py
Browse files4 unmodified lines5678910111213141516171847 unmodified lines66676869707172737475767778798081828384858619 unmodified lines1061071081091101111121134 unmodified linesclient = InferenceClient("HuggingFaceH4/zephyr-7b-beta")# Function to handle chatbot responsesdef respond(message,history: list[tuple[str, str]],system_message,max_tokens,temperature,top_p,):messages = [{"role": "system", "content": system_message}]for val in history:47 unmodified linesvisible=False, # Hide the system message from the displayinteractive=False, # Ensure the user cannot interact with it),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)",),],)19 unmodified linesborder-color: #6fc3df;}.gr-slider {background-color: #e9f7fc;box-shadow: inset 0px 2px 4px rgba(0, 0, 0, 0.1);}"""4 unmodified lines56789101112131415161747 unmodified lines65666768697019 unmodified lines909192939495964 unmodified linesclient = InferenceClient("HuggingFaceH4/zephyr-7b-beta")# Function to handle chatbot responsesdef respond(message, history: list[tuple[str, str]], system_message):# Set default values for max_tokens, temperature, and top_pmax_tokens = 512temperature = 0.7top_p = 0.95# Prepare messages for the chat modelmessages = [{"role": "system", "content": system_message}]for val in history:47 unmodified linesvisible=False, # Hide the system message from the displayinteractive=False, # Ensure the user cannot interact with it),],)19 unmodified linesborder-color: #6fc3df;}.gr-slider {display: none; /* Hides sliders from the interface */}"""
app.py+8-25