-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
test: OpenAI frontend invalid chat tokenizer network issue WAR #7779
Conversation
ae9a260
to
039b510
Compare
3a79a55
to
35ce6dd
Compare
When there is a network issue:
|
tokenizer=invalid_chat_tokenizer, server=server, backend=backend | ||
) | ||
except OSError as e: | ||
expected_msg = f"We couldn't connect to 'https://huggingface.co' to load this file, couldn't find it in the cached files and it looks like {invalid_chat_tokenizer} is not the path to a directory containing a file named config.json." |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is fine for now, but just be wary if the message changes slightly in the future it might not be an exact match.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes. I want to be cautious on this first, to avoid skipping the test for anything else.
If the message varies in the future, I think we can update the condition to detect if the network communication is disabled, i.e. HF_HUB_OFFLINE
, and skip the test based on that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the fix Jacky!
For future reference, this error is probably due to some env var or change to transformers build to disable network communication with HF and only allow pre-downloaded local files, such as via HF_HUB_OFFLINE
What does the PR do?
Allow test_chat_completions_invalid_chat_tokenizer test to be skipped if there is a network issue when accessing the invalid tokenizer.
Checklist
<commit_type>: <Title>
Commit Type:
Check the conventional commit type
box here and add the label to the github PR.
Related PRs:
N/A
Where should the reviewer start?
N/A
Test plan:
The affected test should continue to pass on existing pipeline, and skipped when there is a network issue.
Caveats:
N/A
Background
N/A
Related Issues: (use one of the action keywords Closes / Fixes / Resolves / Relates to)
N/A