ncoop57
commited on
Commit
·
6df5b31
1
Parent(s):
1a5e5f8
Add autocards as req and add autogening flashcards
Browse files- app.py +11 -6
- requirements.txt +1 -0
app.py
CHANGED
@@ -2,14 +2,19 @@ import json
|
|
2 |
|
3 |
import gradio as gr
|
4 |
|
|
|
|
|
|
|
|
|
5 |
def cardify(content):
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
|
|
|
|
|
11 |
return json.dumps(res)
|
12 |
-
#"Hello " + name + "!!"
|
13 |
|
14 |
iface = gr.Interface(fn=cardify, inputs="text", outputs="text")
|
15 |
iface.launch()
|
|
|
2 |
|
3 |
import gradio as gr
|
4 |
|
5 |
+
from autocards.autocards import Autocards
|
6 |
+
|
7 |
+
AUTO = Autocards()
|
8 |
+
|
9 |
def cardify(content):
|
10 |
+
global AUTO
|
11 |
+
|
12 |
+
AUTO.consume_var(content)
|
13 |
+
AUTO.to_json("output.json", prefix="")
|
14 |
+
with open("output_basic.json") as f:
|
15 |
+
res = json.load(f)
|
16 |
+
|
17 |
return json.dumps(res)
|
|
|
18 |
|
19 |
iface = gr.Interface(fn=cardify, inputs="text", outputs="text")
|
20 |
iface.launch()
|
requirements.txt
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
git+https://github.com/ncoop57/Autocards@master#egg=autocards
|