Skip to content

Commit 928c34a

Browse files
authored
add task name for the log (PaddlePaddle#1118)
1 parent 7419d25 commit 928c34a

File tree

5 files changed

+6
-6
lines changed

5 files changed

+6
-6
lines changed

paddlenlp/taskflow/dependency_parsing.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ def __init__(self,
112112
ddparser, ddparser-ernie-1.0 and ddoarser-ernie-gram-zh")
113113
word_vocab_path = download_file(
114114
self._task_path, self.model + os.path.sep + "word_vocab.json",
115-
URLS[self.model][0], URLS[self.model][1])
115+
URLS[self.model][0], URLS[self.model][1], self.model)
116116
rel_vocab_path = download_file(
117117
self._task_path, self.model + os.path.sep + "rel_vocab.json",
118118
URLS[self.model][0], URLS[self.model][1])

paddlenlp/taskflow/lexical_analysis.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ def __init__(self, task, model, **kwargs):
9595
self._usage = usage
9696
word_dict_path = download_file(
9797
self._task_path, "lac_params" + os.path.sep + "word.dic",
98-
URLS['lac_params'][0], URLS['lac_params'][1])
98+
URLS['lac_params'][0], URLS['lac_params'][1], 'lexical_analysis')
9999
tag_dict_path = download_file(
100100
self._task_path, "lac_params" + os.path.sep + "tag.dic",
101101
URLS['lac_params'][0], URLS['lac_params'][1])

paddlenlp/taskflow/sentiment_analysis.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ def _construct_model(self, model):
115115
padding_idx=pad_token_id,
116116
pooling_type='max')
117117
model_path = download_file(self._task_path, model + ".pdparams",
118-
URLS[model][0], URLS[model][1])
118+
URLS[model][0], URLS[model][1], model)
119119

120120
# Load the model parameter for the predict
121121
state_dict = paddle.load(model_path)
@@ -234,7 +234,7 @@ def _construct_model(self, model):
234234
model_instance = SkepSequenceModel.from_pretrained(
235235
model, num_classes=len(self._label_map))
236236
model_path = download_file(self._task_path, model + ".pdparams",
237-
URLS[model][0], URLS[model][1])
237+
URLS[model][0], URLS[model][1], model)
238238
state_dict = paddle.load(model_path)
239239
model_instance.set_state_dict(state_dict)
240240
self._model = model_instance

paddlenlp/taskflow/text_correction.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ def _construct_model(self, model):
139139
pad_pinyin_id=self._pinyin_vocab[self._pinyin_vocab.pad_token])
140140
# Load the model parameter for the predict
141141
model_path = download_file(self._task_path, model + ".pdparams",
142-
URLS[model][0], URLS[model][1])
142+
URLS[model][0], URLS[model][1], model)
143143
state_dict = paddle.load(model_path)
144144
model_instance.set_state_dict(state_dict)
145145
model_instance.eval()

paddlenlp/taskflow/text_generation.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ def __init__(self, task, model, **kwargs):
7474
if self._static_mode:
7575
download_file(self._task_path,
7676
"static" + os.path.sep + "inference.pdiparams",
77-
URLS[self.model][0], URLS[self.model][1])
77+
URLS[self.model][0], URLS[self.model][1], model)
7878
self._get_inference_model()
7979
else:
8080
self._construct_model(model)

0 commit comments

Comments
 (0)