Skip to content

Modify generate() method in GPT2CausalLM to support chatbot #844

@chenmoneygithub

Description

@chenmoneygithub

The gap we have is about the end_token_id. In a chatbot system like DialoGPT , the user prompt needs to be concatenated by an end_token before generation, otherwise it will just generate end_token and stop. One simple fix is to add an argument to generate() method, e.g., append_end_token=False, when which is True the prompt will be appended by an end_token before calling our sampler.

@mattdangerw This should be an easy fix, but we need to make a call on the arg name and if we want to solve it at generate() level.

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions