added -> theme, examples, textbox
Browse files4 unmodified lines567891020 unmodified lines313233343536373839403 unmodified lines444546474849504 unmodified linesmodel_id = "TheBloke/Mistral-7B-Instruct-v0.1-GGUF"model_file = "mistral-7b-instruct-v0.1.Q4_K_M.gguf"model_type = "mistral"quant_model = AutoModelForCausalLM.from_pretrained(model_id, model_file = model_file , model_type= model_type)20 unmodified linesyield responsemistral_chat = gr.ChatInterface(fn = lechat_respond,type = 'messages',additional_inputs=[gr.Slider(minimum=1, maximum=2048, value=512, step=1, label="Max new tokens"),gr.Slider(minimum=0.1, maximum=4.0, value=0.8, step=0.1, label="Temperature"),gr.Slider(3 unmodified linesstep=0.05,label="Top-p (nucleus sampling)",),gr.Slider(minimum = 40, maximum = 31999, value = 40, step = 10, label = "Top-k")],)4 unmodified lines5678910111220 unmodified lines333435363738394041424344454647483 unmodified lines525354555657584 unmodified linesmodel_id = "TheBloke/Mistral-7B-Instruct-v0.1-GGUF"model_file = "mistral-7b-instruct-v0.1.Q4_K_M.gguf"model_type = "mistral"# it's a quantization modelquant_model = AutoModelForCausalLM.from_pretrained(model_id, model_file = model_file , model_type= model_type)20 unmodified linesyield response#chat interface for le_chatmistral_chat = gr.ChatInterface(fn = lechat_respond,type = 'messages',additional_inputs=[textbox = gr.Textbox(placeholder= "Ask whatever"),theme= "ocean",examples= [["Write a haiku about destruction of human's and the raise of AI "],["Which species will rule the earth in the future"]],cache_examples= True,gr.Slider(minimum=1, maximum=2048, value=512, step=1, label="Max new tokens"),gr.Slider(minimum=0.1, maximum=4.0, value=0.8, step=0.1, label="Temperature"),gr.Slider(3 unmodified linesstep=0.05,label="Top-p (nucleus sampling)",),gr.Slider(minimum = 40, maximum = 10000, value = 40, step = 10, label = "Top-k")],)
app.py+9-1