Add tokenutil alias backend support#1
Conversation
|
Mention Blocks like a regular teammate with your question or request: @blocks review this pull request Run |
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 35a41e4223
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| ) | ||
| raise ImportError("TOKENUTIL_SENTENCEPIECE_MODEL is not set") | ||
|
|
||
| processor = spm.SentencePieceProcessor(model_file=model_path) |
There was a problem hiding this comment.
Convert model-load errors into fallbackable ImportError
If TOKENUTIL_SENTENCEPIECE_MODEL is set to an invalid/missing file, SentencePieceProcessor(model_file=...) raises a non-ImportError exception (commonly OSError), which is not caught here. Because count_tokens_for_text only falls back on ImportError, Gemini token counting will raise instead of using the heuristic path, turning a recoverable misconfiguration into a runtime failure.
Useful? React with 👍 / 👎.
Summary
Validation