Skip to content

Commit

Permalink
Allow dev0 of OGA
Browse files Browse the repository at this point in the history
  • Loading branch information
jeremyfowers committed Jan 21, 2025
1 parent 1d20ec7 commit 6d76740
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/lemonade/tools/ort_genai/oga.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,8 +123,11 @@ def generate(

# There is a breaking API change in OGA 0.6.0
# Determine whether we should use the old or new APIs
use_oga_pre_6_api = Version(og.__version__) < Version("0.6.0")
use_oga_post_6_api = not use_oga_pre_6_api
# This also supports 0.6.0.dev0, which evaluates to less than 0.6.0 in Version
use_oga_post_6_api = (
Version(og.__version__) >= Version("0.6.0") or "0.6.0" in og.__version__
)
use_oga_pre_6_api = not use_oga_post_6_api

if pad_token_id:
params.pad_token_id = pad_token_id
Expand Down

0 comments on commit 6d76740

Please sign in to comment.