Spaces:
Runtime error
Runtime error
use develop branch
Browse files- app.py +7 -3
- requirements.txt +1 -1
app.py
CHANGED
@@ -24,7 +24,12 @@ from paddlenlp import Taskflow
|
|
24 |
from paddlenlp.utils.doc_parser import DocParser
|
25 |
|
26 |
doc_parser = DocParser()
|
27 |
-
task_instance = Taskflow(
|
|
|
|
|
|
|
|
|
|
|
28 |
|
29 |
examples = [
|
30 |
[
|
@@ -164,9 +169,8 @@ def get_schema(schema_str):
|
|
164 |
return schema_list, schema_lang
|
165 |
|
166 |
|
167 |
-
def run_taskflow(document, schema
|
168 |
task_instance.set_schema(schema)
|
169 |
-
# task_instance.set_argument(argument)
|
170 |
return task_instance({'doc': document})
|
171 |
|
172 |
|
|
|
24 |
from paddlenlp.utils.doc_parser import DocParser
|
25 |
|
26 |
doc_parser = DocParser()
|
27 |
+
task_instance = Taskflow(
|
28 |
+
"information_extraction",
|
29 |
+
model="uie-x-base",
|
30 |
+
task_path="PaddlePaddle/uie-x-base",
|
31 |
+
from_hf_hub=True,
|
32 |
+
schema="")
|
33 |
|
34 |
examples = [
|
35 |
[
|
|
|
169 |
return schema_list, schema_lang
|
170 |
|
171 |
|
172 |
+
def run_taskflow(document, schema):
|
173 |
task_instance.set_schema(schema)
|
|
|
174 |
return task_instance({'doc': document})
|
175 |
|
176 |
|
requirements.txt
CHANGED
@@ -1,7 +1,7 @@
|
|
1 |
numpy==1.21.6
|
2 |
opencv-python
|
3 |
# install from git for now, wait until v2.4.6 release
|
4 |
-
PaddleNLP
|
5 |
paddleocr
|
6 |
-f https://www.paddlepaddle.org.cn/whl/linux/mkl/avx/stable.html
|
7 |
paddlepaddle-gpu==2.4.1.post112
|
|
|
1 |
numpy==1.21.6
|
2 |
opencv-python
|
3 |
# install from git for now, wait until v2.4.6 release
|
4 |
+
git+https://github.com/PaddlePaddle/PaddleNLP
|
5 |
paddleocr
|
6 |
-f https://www.paddlepaddle.org.cn/whl/linux/mkl/avx/stable.html
|
7 |
paddlepaddle-gpu==2.4.1.post112
|