Spaces:
Sleeping
Sleeping
Update app.py
Browse files11 unmodified lines121314151617189 unmodified lines2829303132333435362 unmodified lines39404142434445464748495011 unmodified linesreturn promptdef generate(prompt, history, system_prompt, temperature=0.3, max_new_tokens=256, top_p=0.9, repetition_penalty=1.0,):temperature = float(temperature)if temperature < 1e-2:9 unmodified linesseed=42,)system_prompt = "You are Mixtral, a gentle and smart AI assistant who is always ready to help and answer any questions truthfully"formatted_prompt = format_prompt(f"{system_prompt}, {prompt}", history)stream = client.text_generation(formatted_prompt, **generate_kwargs, stream=True, details=True, return_full_text=False)output = ""2 unmodified linesyield outputreturn outputmychatbot = gr.Chatbot(avatar_images=["./user.png", "./botm.png"], bubble_full_width=False, show_label=False, show_copy_button=True, likeable=True)demo = gr.ChatInterface(fn=generate,chatbot=mychatbot,title="Tomoniai's Mixtral Chat",retry_btn=None,undo_btn=None)11 unmodified lines121314151617189 unmodified lines28293031323334352 unmodified lines3839404142434445464748495011 unmodified linesreturn promptdef generate(prompt, history, temperature=0.2, max_new_tokens=256, top_p=0.95, repetition_penalty=1.0,):temperature = float(temperature)if temperature < 1e-2:9 unmodified linesseed=42,)formatted_prompt = format_prompt(prompt, history)stream = client.text_generation(formatted_prompt, **generate_kwargs, stream=True, details=True, return_full_text=False)output = ""2 unmodified linesyield outputreturn outputmychatbot = gr.Chatbot(avatar_images=["./user.png", "./botm.png"], bubble_full_width=False, show_label=False, show_copy_button=True,)demo = gr.ChatInterface(fn=generate,chatbot=mychatbot,title="Tomoniai Mixtral Chat",retry_btn=None,undo_btn=None)
app.py+6-6