Skip to content
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

[Bug]: [question generation] template 3 NameError: name 'tokenizer' is not defined #3634

Closed
1 task done
shm007g opened this issue Nov 1, 2022 · 1 comment
Closed
1 task done
Assignees
Labels
bug Something isn't working

Comments

@shm007g
Copy link

shm007g commented Nov 1, 2022

软件环境

- paddlepaddle: 2.3.2
- paddlepaddle-gpu: None
- paddlenlp: 2.4.2

重复问题

  • I have searched the existing issues

错误描述

\paddlenlp\taskflow\question_generation.py", line 194, in _convert_example

source = '这是一个问题生成任务,根据提供的答案和上下文,来生成问题。' + title + tokenizer.sep_token + '上下文:' + source
NameError: name 'tokenizer' is not defined

这里代码有问题,template 3 写了一个没定义的tokenizer。unittest要跟进啊百度gg们。



### 稳定复现步骤 & 代码

Taskflow(
    "question_generation",
    model='unimo-text-1.0-question-generation-dureader_qg',
    # model='unimo-text-1.0-question-generation',
    # model='unimo-text-1.0-dureader_qg',
    # model='unimo-text-1.0',
    template=3,
    device='cpu',
    min_length=1,
    num_beams=15,
    num_return_sequences=10,
    is_select_from_num_return_sequences=False,
    output_scores=True,
)
@shm007g shm007g added the bug Something isn't working label Nov 1, 2022
@LemonNoel LemonNoel assigned LemonNoel and westfish and unassigned LemonNoel Nov 1, 2022
@westfish
Copy link
Contributor

westfish commented Nov 2, 2022

bug已经修复,请参考#3646

@westfish westfish closed this as completed Nov 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants