File size: 998 Bytes
5f4d9e6
 
 
 
 
 
 
 
 
 
 
 
3d3bb15
5f4d9e6
 
 
 
 
 
 
3d3bb15
7a6c8a0
f863aac
5f4d9e6
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
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="/predict"
    )

    # Return the result from the API
    return result

# Define the Gradio interface with a title and description
iface = gr.Interface(
    fn=mistralmed,
    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) ."
)

iface.launch()