import gradio as gr from gradio_client import Client # Initialize the Gradio client client = Client("https://tonic1-mistralmed-chat.hf.space/--replicas/crzkn/") def predict(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." result = client.predict( user_input, system_prompt, api_name="/mistralmed" ) # Return the result from the API return result # Define the Gradio interface with a title and description iface = gr.Interface( fn=predict, inputs=gr.Textbox(label="User Input"), outputs=gr.outputs.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) ." ) iface.launch()