Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -7,10 +7,11 @@ nest_asyncio.apply()
|
|
7 |
|
8 |
def yes_man(message, history):
|
9 |
janus.consult("knowledge_base.pl")
|
10 |
-
tmp = tempfile.NamedTemporaryFile(suffix='.pl')
|
11 |
|
12 |
# Open the file for writing.
|
13 |
-
with open(tmp.name, 'w') as f:
|
|
|
14 |
f.write("""% Define the person
|
15 |
us_citizen(john_doe)
|
16 |
lawfully_residing(john_doe, 'U.S.', date(1996, 1, 1))
|
@@ -20,7 +21,7 @@ condition(john_doe, 'Blind')""")
|
|
20 |
result = janus.query_once("eligible_for_ssi(john_doe)")
|
21 |
else:
|
22 |
result = '\n- '.join(list(janus.query("eligible_for_ssi(john_doe)")))
|
23 |
-
tmp.close()
|
24 |
return result
|
25 |
|
26 |
gr.ChatInterface(
|
|
|
7 |
|
8 |
def yes_man(message, history):
|
9 |
janus.consult("knowledge_base.pl")
|
10 |
+
# tmp = tempfile.NamedTemporaryFile(suffix='.pl')
|
11 |
|
12 |
# Open the file for writing.
|
13 |
+
# with open(tmp.name, 'w') as f:
|
14 |
+
with open("tmp.pl", 'w') as f:
|
15 |
f.write("""% Define the person
|
16 |
us_citizen(john_doe)
|
17 |
lawfully_residing(john_doe, 'U.S.', date(1996, 1, 1))
|
|
|
21 |
result = janus.query_once("eligible_for_ssi(john_doe)")
|
22 |
else:
|
23 |
result = '\n- '.join(list(janus.query("eligible_for_ssi(john_doe)")))
|
24 |
+
# tmp.close()
|
25 |
return result
|
26 |
|
27 |
gr.ChatInterface(
|