Spaces:
Sleeping
Sleeping
Update app.py
Browse files11 unmodified lines12131415151617189 unmodified lines282930313132333334352 unmodified lines3839404142434344454546474748495011 unmodified lines return prompt
def generate( prompt, history, system_prompt, temperature=0.3, max_new_tokens=256, top_p=0.9, repetition_penalty=1.0, 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 lines seed=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(prompt, history)
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 lines yield output return output
mychatbot = gr.Chatbot( avatar_images=["./user.png", "./botm.png"], bubble_full_width=False, show_label=False, show_copy_button=True, likeable=True) avatar_images=["./user.png", "./botm.png"], bubble_full_width=False, show_label=False, show_copy_button=True,)
demo = gr.ChatInterface(fn=generate,demo = gr.ChatInterface(fn=generate, chatbot=mychatbot, title="Tomoniai's Mixtral Chat", title="Tomoniai Mixtral Chat", retry_btn=None, undo_btn=None )app.py+6-6