-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[prompt] update prompt api & add prefix template #3724
Conversation
|
||
4. PaddleNLP 版本:2.3.5 (develop) | ||
4. PaddleNLP 版本:2.4.2 (develop) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这个要么直接2.4.3版本? 后面也可以直接2.4.3版本
最好能依赖关系放在requirements.txt里面
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
已修改为2.4.3版本。相关依赖放在了 requirements_cpu.txt
和 requirements_gpu.txt
文件。
@@ -352,9 +353,9 @@ python infer.py --model_path_prefix checkpoints/export/model --data_dir ./data - | |||
可配置参数说明: | |||
|
|||
- `model_path_prefix`: 导出的静态图模型路径及文件前缀。 | |||
- `model_name_or_path`: 内置预训练模型名,或者模型参数配置目录路径,用于加载tokenizer。默认为`ernie-3.0-base-zh`。 | |||
- `model_name`: 内置预训练模型名,用于加载tokenizer。默认为`ernie-3.0-base-zh`。 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这里为什么model_name_or_path-> model_name ,不可以直接传入一个path进去?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这里model_name
只是为了加载预训练模型相关的参数,用于数据预处理。上边model_path_prefix
才是 Prompt 模型的参数地址,之前两个都带 path
容易混淆。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
PR types
New features
PR changes
APIs
Description
PrefixTemplate
.Verbalizer
.MultiMaskVerbalizer
.InputExample
andInputFeatures
and usedict
instead for flexibility, where keywordlabels
denotes the label id of a data sample.Template new features
Keywords
options
: Used list of labels in template by defining label_file_path / option_list_name_in_example_dict.prefix
: Add prefix soft tokens to inputs on every layer.Attributes
position
: Common. Define the start position id of following blocks.token_type
: Common. Define the token type id of following blocks.add_omask
: Foroptions
. Add[O-MASK]
to each option.add_prompt
: Foroptions
. Add prompt text to each option.encoder
: Forsoft
andprefix
. Define the encoder type.hidden_size
: Forsoft
andprefix
. Define the hidden_size of encoder.length
: Formask
,soft
andprefix
. Define the length of tokens.