Skip to content

Commit

Permalink
Merge pull request #1201 from wawltor/check_release_2.1
Browse files Browse the repository at this point in the history
update the code for the download_file and document
  • Loading branch information
wawltor authored Oct 20, 2021
2 parents 47430dc + 93ce1f4 commit 2791745
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion docs/model_zoo/taskflow.md
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ ddp("百度是一家高科技公司")
>>> [{'word': ['百度', '', '一家', '高科技', '公司'], 'postag': ['ORG', 'v', 'm', 'n', 'n'], 'head': ['2', '0', '5', '5', '2'], 'deprel': ['SBV', 'HED', 'ATT', 'ATT', 'VOB'], 'prob': [1.0, 1.0, 1.0, 1.0, 1.0]}]

# 使用ddparser-ernie-1.0进行预测
ddp = Taskflow("dependency_parsing",model="ddparser-ernie-1.0")
ddp = Taskflow("dependency_parsing", model="ddparser-ernie-1.0")
ddp("百度是一家高科技公司")
>>> [{'word': ['百度', '', '一家', '高科技', '公司'], 'head': ['2', '0', '5', '5', '2'], 'deprel': ['SBV', 'HED', 'ATT', 'ATT', 'VOB']}]
```
Expand Down
2 changes: 1 addition & 1 deletion paddlenlp/taskflow/text_correction.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ def _construct_model(self, model):
pad_pinyin_id=self._pinyin_vocab[self._pinyin_vocab.pad_token])
# Load the model parameter for the predict
model_path = download_file(self._task_path, model + ".pdparams",
URLS[model][0], URLS[model][1], model)
URLS[model][0], URLS[model][1])
state_dict = paddle.load(model_path)
model_instance.set_state_dict(state_dict)
model_instance.eval()
Expand Down

0 comments on commit 2791745

Please sign in to comment.