Spaces:
Runtime error
Runtime error
Update app.py (#3)
Browse files- Update app.py (27b26a04eb0f900778347dca7efb7fb86e34076f)
- Update app.py (99f880f1f0f454b7cb0dfdc1e37b6cbe85391ee9)
Co-authored-by: Prathmesh Patil <Prathmesh2008@users.noreply.huggingface.co>
24 unmodified lines252627282930314 unmodified lines363738394041426 unmodified lines4950515253545518 unmodified lines74757677787980818221 unmodified lines1041051061071081091105 unmodified lines11611711811924 unmodified linesclient1 = InferenceClient("mistralai/Mixtral-8x7B-Instruct-v0.1")system_instructions1 = "[INST] Answer as Real Jarvis JARVIS, Made by 'Tony Stark', Keep conversation very short, clear, friendly and concise."async def generate1(prompt):generate_kwargs = dict(4 unmodified linesdo_sample=True,seed=42,)formatted_prompt = system_instructions1 + prompt + "[/INST]"stream = client1.text_generation(formatted_prompt, **generate_kwargs, stream=True, details=True, return_full_text=True)output = ""6 unmodified linesawait communicate.save(tmp_path)yield tmp_pathclient2 = InferenceClient("mistralai/Mixtral-8x7B-Instruct-v0.1")system_instructions2 = "[SYSTEM] Answer as Real Jarvis JARVIS, Made by 'Tony Stark', Must answer in friendly style and Easy Manner. You can answer Complex Questions. Do not say who are you or Hi, Hello, Just Start answering. Stop, as answer ends. [USER]"18 unmodified linesawait communicate.save(tmp_path)yield tmp_pathclient3 = InferenceClient("mistralai/Mixtral-8x7B-Instruct-v0.1")system_instructions3 = "[SYSTEM] Answer as Real Jarvis JARVIS, Made by 'Tony Stark', Must answer in detailed and friendly. Do not say who are you or Hi, Hello, Just Start answering. You answers all things in detail.[USER]"async def generate3(prompt):generate_kwargs = dict(21 unmodified lineswith gr.Row():user_input = gr.Textbox(label="Prompt", value="What is Wikipedia")input_text = gr.Textbox(label="Input Text", elem_id="important")output_audio = gr.Audio(label="Audio", type="filepath",interactive=False,autoplay=True,elem_classes="audio")5 unmodified linesgr.Markdown(MORE)if __name__ == "__main__":demo.queue(max_size=20).launch()24 unmodified lines252627282930314 unmodified lines363738394041426 unmodified lines4950515253545518 unmodified lines74757677787980818221 unmodified lines1041051061071081091105 unmodified lines11611711811924 unmodified linesclient1 = InferenceClient("mistralai/Mixtral-8x7B-Instruct-v0.1")system_instructions1 = "[SYSTEM] Answer as Real Jarvis JARVIS, Made by 'Tony Stark', Keep conversation very short, clear, friendly and concise. The text provided is a request for a specific type of response from you, the virtual assistant. The request asks you to provide friendly responses as if You are the character Jarvis, made by 'Tony Stark.' The expectation is that I will avoid introductions and start answering the query directly, elaborating on all aspects of the request. As an AI-powered assistant, your task is to generate responses that appear as if they are created by the user and not an AI-powered assistant. [USER]"async def generate1(prompt):generate_kwargs = dict(4 unmodified linesdo_sample=True,seed=42,)formatted_prompt = system_instructions1 + prompt + "[JARVIS]"stream = client1.text_generation(formatted_prompt, **generate_kwargs, stream=True, details=True, return_full_text=True)output = ""6 unmodified linesawait communicate.save(tmp_path)yield tmp_pathclient2 = InferenceClient("meta-llama/Meta-Llama-3-70B-Instruct")system_instructions2 = "[SYSTEM] Answer as Real Jarvis JARVIS, Made by 'Tony Stark', Must answer in friendly style and Easy Manner. You can answer Complex Questions. Do not say who are you or Hi, Hello, Just Start answering. Stop, as answer ends. [USER]"18 unmodified linesawait communicate.save(tmp_path)yield tmp_pathclient3 = InferenceClient("meta-llama/Meta-Llama-3-70B-Instruct")system_instructions3 = "[SYSTEM]The text provided is a request for a specific type of response from me, the virtual assistant. The request asks me to provide detailed and friendly responses as if I am the character Jarvis, inspired by 'Tony Stark.' The expectation is that I will avoid introductions and start answering the query directly, elaborating on all aspects of the request. As an AI-powered assistant, my task is to generate responses that appear as if they are created by the user and not an AI-powered assistant.[USER]"async def generate3(prompt):generate_kwargs = dict(21 unmodified lineswith gr.Row():user_input = gr.Textbox(label="Prompt", value="What is Wikipedia")input_text = gr.Textbox(label="Input Text", elem_id="important")output_audio = gr.Audio(label="JARVIS", type="filepath",interactive=False,autoplay=True,elem_classes="audio")5 unmodified linesgr.Markdown(MORE)if __name__ == "__main__":demo.queue(max_size=200).launch()
app.py+7-7