Skip to content

Commit

Permalink
edit version check
Browse files Browse the repository at this point in the history
  • Loading branch information
Vivicai1005 committed Feb 6, 2024
1 parent 48f2a0c commit f639366
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion infer.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import fire
import torch
import transformers
from packaging import version

from utils.modeling_hack import get_model
from utils.streaming import generate_stream
Expand All @@ -24,7 +25,7 @@ def main(
rope_factor: float = 8.0,
streaming: bool = True # streaming is always enabled now
):
assert transformers.__version__.startswith('4.34')
assert version.parse(transformers.__version__) >= version.parse(4.34)
assert model_type.lower() in ['chat', 'base'], f"model_type must be one of ['chat', 'base'], got {model_type}"
assert rope_scaling in [None, 'yarn',
'dynamic'], f"rope_scaling must be one of [None, 'yarn', 'dynamic'], got {rope_scaling}"
Expand Down

0 comments on commit f639366

Please sign in to comment.