Skip to content

[chat] refactor actor class #3955

@ver217

Description

@ver217

Motivation

Current actor class has method

which makes strategy complex.

In strategy, it must check whether the model is Actor:

def prepare_model(model: nn.Module):

This makes developer confused.

Goal

Make Actor class clearer.

Roadmap

  • Check whether it's training in forward() of Actor. If not, returns the original output of LM model.
  • Extract generate() method of Actor to a function.
  • Update naive experience maker.
  • Refactor unwrap_model() method of Strategy, which should return the original model before prepare().
  • Refactor get_base_model() function, which should return the base HF model. This should be called after being unwrapped.
  • Refactor prepare() method of Strategy.

Metadata

Metadata

Assignees

Labels

chatgptChatGPT Application

Type

No type

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions