ncoop57
commited on
Commit
•
1a5e5f8
1
Parent(s):
637fdc5
fix bug
Browse files
app.py
CHANGED
@@ -1,13 +1,15 @@
|
|
|
|
|
|
1 |
import gradio as gr
|
2 |
|
3 |
-
def
|
4 |
res = {
|
5 |
-
"content":
|
6 |
"questions": ["what is life?", "hi?"],
|
7 |
"answers": ["42", "hola!"]
|
8 |
}
|
9 |
-
return res
|
10 |
#"Hello " + name + "!!"
|
11 |
|
12 |
-
iface = gr.Interface(fn=
|
13 |
iface.launch()
|
|
|
1 |
+
import json
|
2 |
+
|
3 |
import gradio as gr
|
4 |
|
5 |
+
def cardify(content):
|
6 |
res = {
|
7 |
+
"content": content,
|
8 |
"questions": ["what is life?", "hi?"],
|
9 |
"answers": ["42", "hola!"]
|
10 |
}
|
11 |
+
return json.dumps(res)
|
12 |
#"Hello " + name + "!!"
|
13 |
|
14 |
+
iface = gr.Interface(fn=cardify, inputs="text", outputs="text")
|
15 |
iface.launch()
|