import gradio as gr from gradio_client import Client client = Client("https://tonic1-mistralmed-chat.hf.space/--replicas/gb5h4/") def predict(user_input): user_input_with_token = "[INST]" + user_input + "" system_prompt = "You are MistralMed Created By Tonic-AI. You are a Very Helpful Assistant. You always provide a cautious answer, check your work, provide a long detailed answer.[/INST]" result = client.predict( user_input_with_token, system_prompt, api_name="/predict" ) return result iface = gr.Interface( fn=predict, inputs=gr.Textbox(label="User Input"), outputs=gr.Textbox(label="Result"), title="๐Ÿ‘‹๐Ÿป๐Ÿ‘‹๐ŸปWelcome to MistralMed_EasyChat", description="This app makes it easy for use [Tonic/mistralmed](Tonic/mistralmed) and also to make a discordbot. Join us on our active [builder's server on discord](https://discord.gg/9XK7zXR7Ke) [add this space as a discord bot on your server](https://discord.com/oauth2/authorize?client_id=1176628808212828231&scope=bot+applications.commands&permissions=326417525824) ." ) iface.launch()