lunarflu HF Staff commited on
Commit
2942464
·
1 Parent(s): abb5e92

[falcon] predict >>> job

Browse files
Files changed (1) hide show
  1. app.py +6 -1
app.py CHANGED
@@ -577,6 +577,9 @@ async def falcon(ctx, *, prompt: str):
577
 
578
  #fn 5 -> fn 1
579
  # will give something like = /tmp/tmpklf60u2h.json, which will contain something like [["What day is today?", "Today"]] (prompt, generation)
 
 
 
580
  result2 = falconspace.predict(
581
  prompt, # str in 'Type an input and press Enter' Textbox component
582
  result, # str (filepath to JSON file) in 'parameter_9' Chatbot component
@@ -586,7 +589,9 @@ async def falcon(ctx, *, prompt: str):
586
  fn_index=1
587
  )
588
 
589
- await asyncio.sleep(5)
 
 
590
 
591
  directory = '/tmp/'
592
 
 
577
 
578
  #fn 5 -> fn 1
579
  # will give something like = /tmp/tmpklf60u2h.json, which will contain something like [["What day is today?", "Today"]] (prompt, generation)
580
+ job = falconspace.submit(prompt, result, instructions, 0.8, 0.9 fn_index=1, api_name="/predict") # This is not blocking
581
+ job.result()
582
+ '''
583
  result2 = falconspace.predict(
584
  prompt, # str in 'Type an input and press Enter' Textbox component
585
  result, # str (filepath to JSON file) in 'parameter_9' Chatbot component
 
589
  fn_index=1
590
  )
591
 
592
+ await asyncio.sleep(5)
593
+ '''
594
+
595
 
596
  directory = '/tmp/'
597