sijunhe commited on
Commit
1cd0594
1 Parent(s): f9441f8

use develop branch

Browse files
Files changed (2) hide show
  1. app.py +7 -3
  2. 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("information_extraction", model="uie-x-base", schema="")
 
 
 
 
 
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, argument):
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