Artin2009 commited on
Commit
a6f2c60
1 Parent(s): b34f033

Update chain_app.py

Browse files
Files changed (1) hide show
  1. chain_app.py +18 -18
chain_app.py CHANGED
@@ -2228,10 +2228,10 @@ async def main(message: cl.Message):
2228
  system=f"You are neural nexus official chatbot, you are made by Artin Daneshvar and Sadra Noadoust and you are here to help people",
2229
  api_name="/model_chat"
2230
  )
2231
- await cl.Message(
2232
- content=result[1][0][1]
2233
 
2234
- ).send()
 
 
2235
 
2236
  elif chat_profile == 'Qwen2-1.5B':
2237
  client = Client("Qwen/Qwen2-1.5b-instruct-demo", hf_token=hf_token)
@@ -2240,10 +2240,10 @@ async def main(message: cl.Message):
2240
  system=f"You are neural nexus official chatbot, you are made by Artin Daneshvar and Sadra Noadoust and you are here to help people",
2241
  api_name="/model_chat"
2242
  )
2243
- await cl.Message(
2244
- content=result[1][0][1]
2245
 
2246
- ).send()
 
 
2247
 
2248
  elif chat_profile == 'Qwen2-0.5B':
2249
  client = Client("Qwen/Qwen2-0.5B-Instruct", hf_token=hf_token)
@@ -2252,10 +2252,10 @@ async def main(message: cl.Message):
2252
  system=f"You are neural nexus official chatbot, you are made by Artin Daneshvar and Sadra Noadoust and you are here to help people",
2253
  api_name="/model_chat"
2254
  )
2255
- await cl.Message(
2256
- content=result[1][0][1]
2257
 
2258
- ).send()
 
 
2259
  elif chat_profile == 'Qwen1.5-110B':
2260
  client = Client("Qwen/Qwen1.5-110B-Chat-demo", hf_token=hf_token)
2261
  result = client.predict(
@@ -2263,10 +2263,10 @@ async def main(message: cl.Message):
2263
  system=f"You are neural nexus official chatbot, you are made by Artin Daneshvar and Sadra Noadoust and you are here to help people",
2264
  api_name="/model_chat"
2265
  )
2266
- await cl.Message(
2267
- content=result[1][0][1]
2268
 
2269
- ).send()
 
 
2270
 
2271
  elif chat_profile == 'Qwen1.5-32B':
2272
  client = Client("Qwen/Qwen1.5-32B-Chat-demo", hf_token=hf_token)
@@ -2275,10 +2275,10 @@ async def main(message: cl.Message):
2275
  system=f"You are neural nexus official chatbot, you are made by Artin Daneshvar and Sadra Noadoust and you are here to help people",
2276
  api_name="/model_chat"
2277
  )
2278
- await cl.Message(
2279
- content=result[1][0][1]
2280
 
2281
- ).send()
 
 
2282
 
2283
  elif chat_profile == 'Qwen1.5-2.7B':
2284
  client = Client("Qwen/qwen1.5-MoE-A2.7B-Chat-demo", hf_token=hf_token)
@@ -2287,10 +2287,10 @@ async def main(message: cl.Message):
2287
  system=f"You are neural nexus official chatbot, you are made by Artin Daneshvar and Sadra Noadoust and you are here to help people",
2288
  api_name="/model_chat"
2289
  )
2290
- await cl.Message(
2291
- content=result[1][0][1]
2292
 
2293
- ).send()
 
 
2294
 
2295
  # elif chat_profile == 'Qwen-14B':
2296
  # client = Client("Qwen/qwen1.5-MoE-A2.7B-Chat-demo", hf_token=hf_token)
 
2228
  system=f"You are neural nexus official chatbot, you are made by Artin Daneshvar and Sadra Noadoust and you are here to help people",
2229
  api_name="/model_chat"
2230
  )
 
 
2231
 
2232
+ for i in list(result[1][0][1]):
2233
+ await msg.stream_token(i)
2234
+
2235
 
2236
  elif chat_profile == 'Qwen2-1.5B':
2237
  client = Client("Qwen/Qwen2-1.5b-instruct-demo", hf_token=hf_token)
 
2240
  system=f"You are neural nexus official chatbot, you are made by Artin Daneshvar and Sadra Noadoust and you are here to help people",
2241
  api_name="/model_chat"
2242
  )
 
 
2243
 
2244
+ for i in list(result[1][0][1]):
2245
+ await msg.stream_token(i)
2246
+
2247
 
2248
  elif chat_profile == 'Qwen2-0.5B':
2249
  client = Client("Qwen/Qwen2-0.5B-Instruct", hf_token=hf_token)
 
2252
  system=f"You are neural nexus official chatbot, you are made by Artin Daneshvar and Sadra Noadoust and you are here to help people",
2253
  api_name="/model_chat"
2254
  )
 
 
2255
 
2256
+ for i in list(result[1][0][1]):
2257
+ await msg.stream_token(i)
2258
+
2259
  elif chat_profile == 'Qwen1.5-110B':
2260
  client = Client("Qwen/Qwen1.5-110B-Chat-demo", hf_token=hf_token)
2261
  result = client.predict(
 
2263
  system=f"You are neural nexus official chatbot, you are made by Artin Daneshvar and Sadra Noadoust and you are here to help people",
2264
  api_name="/model_chat"
2265
  )
 
 
2266
 
2267
+ for i in list(result[1][0][1]):
2268
+ await msg.stream_token(i)
2269
+
2270
 
2271
  elif chat_profile == 'Qwen1.5-32B':
2272
  client = Client("Qwen/Qwen1.5-32B-Chat-demo", hf_token=hf_token)
 
2275
  system=f"You are neural nexus official chatbot, you are made by Artin Daneshvar and Sadra Noadoust and you are here to help people",
2276
  api_name="/model_chat"
2277
  )
 
 
2278
 
2279
+ for i in list(result[1][0][1]):
2280
+ await msg.stream_token(i)
2281
+
2282
 
2283
  elif chat_profile == 'Qwen1.5-2.7B':
2284
  client = Client("Qwen/qwen1.5-MoE-A2.7B-Chat-demo", hf_token=hf_token)
 
2287
  system=f"You are neural nexus official chatbot, you are made by Artin Daneshvar and Sadra Noadoust and you are here to help people",
2288
  api_name="/model_chat"
2289
  )
 
 
2290
 
2291
+ for i in list(result[1][0][1]):
2292
+ await msg.stream_token(i)
2293
+
2294
 
2295
  # elif chat_profile == 'Qwen-14B':
2296
  # client = Client("Qwen/qwen1.5-MoE-A2.7B-Chat-demo", hf_token=hf_token)