File size: 1,116 Bytes
5f4d9e6
 
 
2471034
5f4d9e6
9a62204
7d2e276
 
5f4d9e6
 
1a26868
5f4d9e6
3d3bb15
5f4d9e6
 
 
 
 
9a62204
7a6c8a0
f863aac
5f4d9e6
58a4569
5f4d9e6
 
2bce80d
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
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()