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

updating gptj-config #109

Merged
merged 9 commits into from
Dec 4, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions configs/ppo_gptj.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@ method:
cliprange: 0.2 # clip range
cliprange_value: 0.2 # clip range
vf_coef: 0.2 # value term weight
scale_reward: False # False | "ref" | "running" estimate against which to scale rewards
ref_mean: null
ref_std: null # rescale rewards with this deviation
cliprange_reward: 10
gen_kwargs:
max_length: 48 # LM max sample gen length
min_length: 48 # LM min sample gen length
Expand Down
3 changes: 1 addition & 2 deletions examples/ppo_sentiments.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ def get_positive_score(scores):
return dict(map(lambda x: tuple(x.values()), scores))["POSITIVE"]


default_config = yaml.safe_load(open("configs/ppo_config.yml"))
default_config = yaml.safe_load(open("configs/ppo_gptj.yml"))
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

are you sure you want to change the default to gpt-j? I wouldn't mind the second script which imports main from here and changes config as the most simplest option right now, until we switch to hydra or something else

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed, this is a bad idea.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah I just forgot to change this back.



def main(hparams={}):
Expand Down Expand Up @@ -46,7 +46,6 @@ def reward_fn(samples: List[str]) -> List[float]:
prompts = [" ".join(review.split()[:4]) for review in imdb["text"]]

model = trlx.train(
"lvwerra/gpt2-imdb",
reward_fn=reward_fn,
prompts=prompts,
eval_prompts=["I don't know much about Hungarian underground"] * 64,
Expand Down