lunarflu HF Staff commited on
Commit
7666cce
·
1 Parent(s): a2604a1

[falcon] testing

Browse files
Files changed (1) hide show
  1. app.py +35 -15
app.py CHANGED
@@ -565,29 +565,49 @@ async def falcon(ctx, *, prompt: str):
565
  try:
566
  if await safetychecks(ctx):
567
  if ctx.channel.id == 1116089829147557999:
 
568
 
569
- #filepath = "test1.json"
570
- #os.makedirs(filepath)
571
- result = falconspace.predict(
572
- prompt, # str in 'Type an input and press Enter' Textbox component
573
- "newgen", # str (filepath to JSON file) in 'parameter_9' Chatbot component
574
- "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.", # str in 'Instructions' Textbox component
575
- 0.8, # int | float (numeric value between 0.1 and 2.0) in 'Temperature' Slider component
576
- 0.9, # int | float (numeric value between 0.1 and 0.99) in 'p (nucleus sampling)' Slider component
577
- fn_index=1
578
- )
579
-
580
- with open(result, "r") as file:
581
- data = json.load(file)
582
 
583
- await ctx.reply(f"Here's the resulting json file:\n{data}")
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
584
 
585
  except Exception as e:
586
  print(f"Error: {e}")
587
  await ctx.reply(f"{e} cc <@811235357663297546> (falcon error)")
588
  #----------------------------------------------------------------------------------------------------------------------------
589
-
 
 
 
 
 
 
590
 
 
 
 
 
 
 
 
 
 
 
591
  def run_bot():
592
  bot.run(DISCORD_TOKEN)
593
 
 
565
  try:
566
  if await safetychecks(ctx):
567
  if ctx.channel.id == 1116089829147557999:
568
+
569
 
570
+ result = falconspace.predict(fn_index=5) # result will be something like = /tmp/tmpjmz7f_9u.json, which will contain []
 
 
 
 
 
 
 
 
 
 
 
 
571
 
572
+ 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."
573
+
574
+ #fn 5 -> fn 1
575
+ # will give something like = /tmp/tmpklf60u2h.json, which will contain something like [["What day is today?", "Today"]] (prompt, generation)
576
+ result2 = falconspace.predict(
577
+ prompt, # str in 'Type an input and press Enter' Textbox component
578
+ result, # str (filepath to JSON file) in 'parameter_9' Chatbot component
579
+ instructions, # str in 'Instructions' Textbox component
580
+ 0.8, # int | float (numeric value between 0.1 and 2.0) in 'Temperature' Slider component
581
+ 0.9, # int | float (numeric value between 0.1 and 0.99) in 'p (nucleus sampling)' Slider component
582
+ fn_index=1
583
+ )
584
+
585
+ with open(result2, "r") as file:
586
+ data = json.load(file)
587
+ await ctx.reply(f"Here's the resulting json file:\n{data}")
588
 
589
  except Exception as e:
590
  print(f"Error: {e}")
591
  await ctx.reply(f"{e} cc <@811235357663297546> (falcon error)")
592
  #----------------------------------------------------------------------------------------------------------------------------
593
+ '''
594
+ @bot.event
595
+ async def on_message(message):
596
+ try:
597
+ if message.channel.id == 1116089829147557999:
598
+
599
+
600
 
601
+ except Exception as e:
602
+ print(f"Error: {e}")
603
+ await ctx.reply(f"{e} cc <@811235357663297546> (falcon error)")
604
+
605
+ '''
606
+ #----------------------------------------------------------------------------------------------------------------------------
607
+
608
+
609
+
610
+
611
  def run_bot():
612
  bot.run(DISCORD_TOKEN)
613