Artin2009 commited on
Commit
2577ba3
·
verified ·
1 Parent(s): 259fe0a

Update chain_app.py

Browse files
Files changed (1) hide show
  1. chain_app.py +35 -0
chain_app.py CHANGED
@@ -1002,11 +1002,46 @@ async def main(message: cl.Message):
1002
  system="You are a helpful AI chatbot made by two iranian boys named Artin Daneshvar and Sadra Noadoust",
1003
  api_name="/model_chat"
1004
  )
 
 
 
 
 
 
 
 
 
 
 
1005
  await cl.Message(
1006
  content=result[1][0][1]
1007
 
1008
  ).send()
1009
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1010
  elif chat_profile == 'Llama-3.1-405B':
1011
  client = InferenceClient(
1012
  "meta-llama/Meta-Llama-3.1-405B-Instruct",
 
1002
  system="You are a helpful AI chatbot made by two iranian boys named Artin Daneshvar and Sadra Noadoust",
1003
  api_name="/model_chat"
1004
  )
1005
+ await cl.Message(
1006
+ content=result[1][0][1]
1007
+ ).send()
1008
+
1009
+ elif chat_profile == 'Qwen2-7B':
1010
+ client = Client("Qwen/Qwen2-7b-instruct-demo", hf_token=hf_token)
1011
+ result = client.predict(
1012
+ query=message.content,
1013
+ system="You are a helpful AI chatbot made by two iranian boys named Artin Daneshvar and Sadra Noadoust",
1014
+ api_name="/model_chat"
1015
+ )
1016
  await cl.Message(
1017
  content=result[1][0][1]
1018
 
1019
  ).send()
1020
 
1021
+ elif chat_profile == 'Qwen2-1.5B':
1022
+ client = Client("Qwen/Qwen2-1.5b-instruct-demo", hf_token=hf_token)
1023
+ result = client.predict(
1024
+ query=message.content,
1025
+ system="You are a helpful AI chatbot made by two iranian boys named Artin Daneshvar and Sadra Noadoust",
1026
+ api_name="/model_chat"
1027
+ )
1028
+ await cl.Message(
1029
+ content=result[1][0][1]
1030
+
1031
+ ).send()
1032
+
1033
+ elif chat_profile == 'Qwen2-0.5B':
1034
+ client = Client("Qwen/Qwen2-0.5B-Instruct", hf_token=hf_token)
1035
+ result = client.predict(
1036
+ query=message.content,
1037
+ system="You are a helpful AI chatbot made by two iranian boys named Artin Daneshvar and Sadra Noadoust",
1038
+ api_name="/model_chat"
1039
+ )
1040
+ await cl.Message(
1041
+ content=result[1][0][1]
1042
+
1043
+ ).send()
1044
+
1045
  elif chat_profile == 'Llama-3.1-405B':
1046
  client = InferenceClient(
1047
  "meta-llama/Meta-Llama-3.1-405B-Instruct",