Skip to content

wip : Change gated model to tinyllama#292

Open
arekay-nv wants to merge 1 commit intofeat/alicheng-pubsub-integrationfrom
arekay/fix-ci-tinyllama
Open

wip : Change gated model to tinyllama#292
arekay-nv wants to merge 1 commit intofeat/alicheng-pubsub-integrationfrom
arekay/fix-ci-tinyllama

Conversation

@arekay-nv
Copy link
Copy Markdown
Collaborator

What does this PR do?

Type of change

  • Bug fix
  • New feature
  • Documentation update
  • Refactor/cleanup

Related issues

Testing

  • Tests added/updated
  • All tests pass locally
  • Manual testing completed

Checklist

  • Code follows project style
  • Pre-commit hooks pass
  • Documentation updated (if needed)

Signed-off-by: Rashid Kaleem <230885705+arekay-nv@users.noreply.github.com>
@arekay-nv arekay-nv requested a review from a team as a code owner April 22, 2026 21:44
@github-actions
Copy link
Copy Markdown

MLCommons CLA bot All contributors have signed the MLCommons CLA ✍️ ✅

@github-actions github-actions Bot requested a review from nvzhihanj April 22, 2026 21:45
Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request updates the default placeholder model to TinyLlama across various templates and scripts. It also introduces more robust handling for gated Hugging Face repositories by checking for access permissions before attempting to load tokenizers, allowing the system to fall back gracefully if access is denied. Review feedback suggests that the string-based error matching for gated repositories may be fragile and recommends ensuring that the huggingface_hub dependency is updated to at least version 0.23.0 to support the auth_check method.

Comment on lines +102 to +119
except (GatedRepoError, OSError) as e:
# transformers re-raises GatedRepoError as OSError containing "gated"
if isinstance(e, GatedRepoError) or "gated" in str(e).lower():
logger.warning(
"Tokenizer '%s' is a gated HuggingFace repo and this "
"environment has no access. Set HF_TOKEN or use an "
"ungated model to enable token metrics. Continuing "
"without token metrics (ISL/OSL/TPOT unavailable).",
args.tokenizer,
)
else:
logger.warning(
"Failed to load tokenizer '%s': %s. Continuing without "
"token metrics (ISL/OSL/TPOT unavailable).",
args.tokenizer,
e,
)
pool_cm = nullcontext()
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

The error handling for TokenizePool initialization is robust, but the string matching on OSError (line 104) is slightly fragile as it depends on the internal error message format of the transformers library. While this is a known pattern for gated repo errors in transformers, consider if there's a more reliable way to detect this, or ensure that any other OSError that might occur during initialization is also handled correctly (which the else block currently does).

Comment on lines +203 to +213
if info.gated:
try:
HfApi().auth_check(repo_id=model_name)
except GatedRepoError:
logger.warning(
f"Model '{model_name}' is a gated HuggingFace repo and "
"this environment has no access. Set HF_TOKEN or use an "
"ungated model to enable token metrics. Continuing "
"without token metrics (ISL/OSL/TPOT unavailable)."
)
return False
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

The addition of HfApi().auth_check is a good proactive measure to verify access to gated repositories before launching the aggregator subprocess. However, note that auth_check was introduced in huggingface_hub version 0.23.0. If the environment uses an older version, this call will raise an AttributeError. While the general except Exception block at line 222 will catch this and allow the benchmark to continue without token metrics, it might be worth ensuring the project's dependencies are updated to reflect this requirement.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants