Skip to content

Commit

Permalink
Merge pull request #23 from aalok-sathe/bugfix/cli-propogate-bos-toke…
Browse files Browse the repository at this point in the history
…n-arg

CLI wasn't actually using the BOS token arg; make sure to pass it in case of gpt-like models
  • Loading branch information
aalok-sathe authored Dec 3, 2024
2 parents bd49e84 + f3abb81 commit 2c6f250
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions surprisal/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,11 @@
args.model_name_or_path, model_class=args.model_class
)

[surp] = m.surprise(args.text)

if args.model_class in ('gpt', 'causal'):
[surp] = m.surprise(args.text, use_bos_token=not args.no_bos_token)
else:
[surp] = m.surprise(args.text)

if args.plot:
from matplotlib import pyplot as plt

Expand Down

0 comments on commit 2c6f250

Please sign in to comment.