Spaces:

npc0 commited on
Commit
7d70942
1 Parent(s): 2ca2069

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -1
app.py CHANGED
@@ -1,6 +1,9 @@
1
  import tempfile
2
  import gradio as gr
3
  import janus_swi as janus
 
 
 
4
 
5
  def yes_man(message, history):
6
  janus.consult("knowledge_base.pl")
@@ -17,7 +20,7 @@ condition(john_doe, 'Blind')""")
17
  if message.endswith("?"):
18
  return janus.query_once("eligible_for_ssi(john_doe)")
19
  else:
20
- yield janus.query("eligible_for_ssi(john_doe)")
21
 
22
  gr.ChatInterface(
23
  yes_man,
 
1
  import tempfile
2
  import gradio as gr
3
  import janus_swi as janus
4
+ import nest_asyncio
5
+
6
+ nest_asyncio.apply()
7
 
8
  def yes_man(message, history):
9
  janus.consult("knowledge_base.pl")
 
20
  if message.endswith("?"):
21
  return janus.query_once("eligible_for_ssi(john_doe)")
22
  else:
23
+ return '\n- '.join(list(janus.query("eligible_for_ssi(john_doe)")))
24
 
25
  gr.ChatInterface(
26
  yes_man,