Artin2009 commited on
Commit
412354d
·
verified ·
1 Parent(s): e1375ee

Update chain_app.py

Browse files
Files changed (1) hide show
  1. chain_app.py +39 -0
chain_app.py CHANGED
@@ -194,6 +194,10 @@ async def chat_profile():
194
  name="zephyr-7B",
195
  markdown_description="Open Source model Zephyr with 7B parameters",
196
  ),
 
 
 
 
197
  cl.ChatProfile(
198
  name='mixtral-8x7B',
199
  markdown_description = 'mistral open source LLM with 7B parameters'
@@ -1050,6 +1054,29 @@ async def on_chat_start():
1050
  await cl.Message(
1051
  content="Im Mistral. the small version of Mistral Family. i was configured by Artin Daneshvar and Sadra Noadoust, 2 iranian students to help you, how can i assist you today ? "
1052
  ).send()
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1053
  # if chat_profile == 'Toka-353M':
1054
  # await cl.ChatSettings(
1055
  # [
@@ -1572,6 +1599,18 @@ async def main(message: cl.Message):
1572
 
1573
  await cl.Message(content=complete_content).send()
1574
 
 
 
 
 
 
 
 
 
 
 
 
 
1575
  # elif chat_profile == 'Toka-353M':
1576
  # output = query({
1577
  # "inputs": message.content,
 
194
  name="zephyr-7B",
195
  markdown_description="Open Source model Zephyr with 7B parameters",
196
  ),
197
+ cl.ChatProfile(
198
+ name='mistral-nemo-12B',
199
+ markdown_description='mistral open source LLM with 12B parameters'
200
+ ),
201
  cl.ChatProfile(
202
  name='mixtral-8x7B',
203
  markdown_description = 'mistral open source LLM with 7B parameters'
 
1054
  await cl.Message(
1055
  content="Im Mistral. the small version of Mistral Family. i was configured by Artin Daneshvar and Sadra Noadoust, 2 iranian students to help you, how can i assist you today ? "
1056
  ).send()
1057
+
1058
+ if chat_profile == 'mistral-nemo-12B':
1059
+ await cl.ChatSettings(
1060
+ [
1061
+ Select(
1062
+ id="Mistral-Model",
1063
+ label="Mistral - Model",
1064
+ values=["mistral-nemo-12B"],
1065
+ initial_index=0,
1066
+ ),
1067
+ Slider(
1068
+ id="Temperature",
1069
+ label="Model Temperature",
1070
+ initial=0.7,
1071
+ min=0,
1072
+ max=1,
1073
+ step=0.1,
1074
+ ),
1075
+ ]
1076
+ ).send()
1077
+ await cl.Message(
1078
+ content="Im Mistral nemo 12B .i was configured by Artin Daneshvar and Sadra Noadoust, 2 iranian students to help you, how can i assist you today ? "
1079
+ ).send()
1080
  # if chat_profile == 'Toka-353M':
1081
  # await cl.ChatSettings(
1082
  # [
 
1599
 
1600
  await cl.Message(content=complete_content).send()
1601
 
1602
+ elif chat_profile == 'mistral-nemo-12B':
1603
+ client = Client("0x7o/Mistral-Nemo-Instruct", hf_token=hf_token)
1604
+ result = client.predict(
1605
+ query=message.content,
1606
+ system="You are a helpful AI chatbot made by two iranian boys named Artin Daneshvar and Sadra Noadoust",
1607
+ api_name="/model_chat"
1608
+ )
1609
+ await cl.Message(
1610
+ content=result[1][0][1]
1611
+
1612
+ ).send()
1613
+
1614
  # elif chat_profile == 'Toka-353M':
1615
  # output = query({
1616
  # "inputs": message.content,