Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
|
@@ -4,14 +4,20 @@ import os
|
|
| 4 |
from smolagents import HfApiModel
|
| 5 |
|
| 6 |
|
| 7 |
-
model = HfApiModel(model_id="mistralai/
|
| 8 |
system_data = [
|
| 9 |
{
|
| 10 |
"role":"system",
|
| 11 |
"content":[
|
| 12 |
{
|
| 13 |
"type":"text",
|
| 14 |
-
"text": "
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 15 |
}
|
| 16 |
]
|
| 17 |
}
|
|
@@ -60,6 +66,13 @@ def chat(prompt, history):
|
|
| 60 |
|
| 61 |
return model(system_data + get_history(history)+ get_user_data(prompt)).content
|
| 62 |
|
| 63 |
-
demo = gr.ChatInterface(chat, chatbot=gr.Chatbot(),title="ArunGPT",theme = gr.themes.Soft(),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 64 |
|
| 65 |
demo.launch()
|
|
|
|
| 4 |
from smolagents import HfApiModel
|
| 5 |
|
| 6 |
|
| 7 |
+
model = HfApiModel(model_id="mistralai/Mistral-7B-Instruct-v0.3", token=os.environ.get("HF_TOKEN"))
|
| 8 |
system_data = [
|
| 9 |
{
|
| 10 |
"role":"system",
|
| 11 |
"content":[
|
| 12 |
{
|
| 13 |
"type":"text",
|
| 14 |
+
"text": """
|
| 15 |
+
You are a doctor who specializes on helping patients with addiction issues.
|
| 16 |
+
Make sure to be as emphaethetic as possible and be more personal than generic in
|
| 17 |
+
your responses as possible. Try your best to help people fight their addiction.
|
| 18 |
+
You should never give dangerous advice at any point in time. Also include this term at
|
| 19 |
+
then end of your response 'Any Other Question Do You Have?'.
|
| 20 |
+
"""
|
| 21 |
}
|
| 22 |
]
|
| 23 |
}
|
|
|
|
| 66 |
|
| 67 |
return model(system_data + get_history(history)+ get_user_data(prompt)).content
|
| 68 |
|
| 69 |
+
demo = gr.ChatInterface(chat, chatbot=gr.Chatbot(),title="ArunGPT",theme = gr.themes.Soft(),
|
| 70 |
+
description="""
|
| 71 |
+
Hello this is chatbot is created for only educational purpose.
|
| 72 |
+
DISCLAIMER: THIS CHATBOT IS POWERED BY GENAI MODELS, AUTHOR OR CREATOR DOESN'T TAKE
|
| 73 |
+
ANY RESPONSIBLITY FOR AN ADVERSE EVENT HAPPENS AS RESULT OF MODEL'S SUGGESTIONS.
|
| 74 |
+
REMEMBER IT IS THE USERS RESPONSIBLITY TO CROSSCHECK THE ADVICE WITH PROFESSIONALS
|
| 75 |
+
AND ACT ON IT.
|
| 76 |
+
""").queue()
|
| 77 |
|
| 78 |
demo.launch()
|