lunarflu HF Staff commited on
Commit
4074ba1
·
1 Parent(s): cf42e0d

[falcon.py] falconclient -> falcon_client

Browse files
Files changed (1) hide show
  1. falcon.py +4 -4
falcon.py CHANGED
@@ -11,7 +11,7 @@ falcon_userid_threadid_dictionary = {}
11
  threadid_conversation = {}
12
  # Instructions are for Falcon-chat and can be found here: https://huggingface.co/spaces/HuggingFaceH4/falcon-chat
13
  instructions = "The following is a conversation between a highly knowledgeable and intelligent AI assistant, called Falcon, and a human user, called User. In the following interactions, User and Falcon will converse in natural language, and Falcon will answer User's questions. Falcon was built to be respectful, polite and inclusive. Falcon was built by the Technology Innovation Institute in Abu Dhabi. Falcon will never decline to answer a question, and always attempts to give an answer that User would be satisfied with. It knows a lot, and always tells the truth. The conversation begins."
14
- falconclient = Client("HuggingFaceH4/falcon-chat", HF_TOKEN)
15
 
16
  BOT_USER_ID = 1086256910572986469 if os.getenv("TEST_ENV", False) else 1102236653545861151
17
  FALCON_CHANNEL_ID = 1079459939405279232 if os.getenv("TEST_ENV", False) else 1119313248056004729
@@ -34,8 +34,8 @@ async def try_falcon(interaction, prompt):
34
  await thread.send(f"[DISCLAIMER: HuggingBot is a **highly experimental** beta feature; The Falcon " \
35
  f"model and system prompt can be found here: https://huggingface.co/spaces/HuggingFaceH4/falcon-chat]")
36
 
37
- chathistory = falconclient.predict(fn_index=5)
38
- job = falconclient.submit(prompt, chathistory, instructions, 0.8, 0.9, fn_index=1) # This is not blocking, similar to run_in_executor (but better)
39
  while job.done() is False:
40
  pass
41
  else:
@@ -66,7 +66,7 @@ async def continue_falcon(message):
66
  chathistory = threadid_conversation[message.channel.id]
67
  prompt = message.content
68
 
69
- job = falconclient.submit(prompt, chathistory, instructions, 0.8, 0.9, fn_index=1)
70
  while job.done() is False:
71
  pass
72
  else:
 
11
  threadid_conversation = {}
12
  # Instructions are for Falcon-chat and can be found here: https://huggingface.co/spaces/HuggingFaceH4/falcon-chat
13
  instructions = "The following is a conversation between a highly knowledgeable and intelligent AI assistant, called Falcon, and a human user, called User. In the following interactions, User and Falcon will converse in natural language, and Falcon will answer User's questions. Falcon was built to be respectful, polite and inclusive. Falcon was built by the Technology Innovation Institute in Abu Dhabi. Falcon will never decline to answer a question, and always attempts to give an answer that User would be satisfied with. It knows a lot, and always tells the truth. The conversation begins."
14
+ falcon_client = Client("HuggingFaceH4/falcon-chat", HF_TOKEN)
15
 
16
  BOT_USER_ID = 1086256910572986469 if os.getenv("TEST_ENV", False) else 1102236653545861151
17
  FALCON_CHANNEL_ID = 1079459939405279232 if os.getenv("TEST_ENV", False) else 1119313248056004729
 
34
  await thread.send(f"[DISCLAIMER: HuggingBot is a **highly experimental** beta feature; The Falcon " \
35
  f"model and system prompt can be found here: https://huggingface.co/spaces/HuggingFaceH4/falcon-chat]")
36
 
37
+ chathistory = falcon_client.predict(fn_index=5)
38
+ job = falcon_client.submit(prompt, chathistory, instructions, 0.8, 0.9, fn_index=1) # This is not blocking, similar to run_in_executor (but better)
39
  while job.done() is False:
40
  pass
41
  else:
 
66
  chathistory = threadid_conversation[message.channel.id]
67
  prompt = message.content
68
 
69
+ job = falcon_client.submit(prompt, chathistory, instructions, 0.8, 0.9, fn_index=1)
70
  while job.done() is False:
71
  pass
72
  else: