Skip to content
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

Add revision and trust_remote_code to from_pretrained calls #224

Merged

Conversation

chiragjn
Copy link
Contributor

I was trying out Snowflake/snowflake-arctic-embed-m-long with onnx engine

infinity_emb --model-name-or-path Snowflake/snowflake-arctic-embed-m-long --revision 08e7a4449e3f07709fb9387bc3172d393a6cc5e2 --engine optimum --device cpu --dtype float32 --batch-size 4 --port 8000 --trust-remote-code 

But trust_remote_code is not being passed along

  File "/app/infinity_emb/transformer/embedder/optimum.py", line 51, in __init__
    self.model = optimize_model(
  File "/app/infinity_emb/transformer/utils_optimum.py", line 107, in optimize_model
    unoptimized_model_path = model_class.from_pretrained(
  File "/app/.venv/lib/python3.10/site-packages/optimum/onnxruntime/modeling_ort.py", line 669, in from_pretrained
    return super().from_pretrained(
  File "/app/.venv/lib/python3.10/site-packages/optimum/modeling_base.py", line 373, in from_pretrained
    config = cls._load_config(
  File "/app/.venv/lib/python3.10/site-packages/optimum/modeling_base.py", line 231, in _load_config
    config = AutoConfig.from_pretrained(
  File "/app/.venv/lib/python3.10/site-packages/transformers/models/auto/configuration_auto.py", line 1141, in from_pretrained
    trust_remote_code = resolve_trust_remote_code(
  File "/app/.venv/lib/python3.10/site-packages/transformers/dynamic_module_utils.py", line 622, in resolve_trust_remote_code
    raise ValueError(
ValueError: Loading Snowflake/snowflake-arctic-embed-m-long requires you to execute the configuration file in that repo on your local machine. Make sure you have read the code there to avoid malicious use, then set the option `trust_remote_code=True` to remove this error.

@codecov-commenter
Copy link

codecov-commenter commented May 17, 2024

Codecov Report

Attention: Patch coverage is 0% with 2 lines in your changes are missing coverage. Please review.

Project coverage is 74.27%. Comparing base (8d78747) to head (98fb360).
Report is 2 commits behind head on main.

Files Patch % Lines
...ty_emb/infinity_emb/transformer/embedder/neuron.py 0.00% 2 Missing ⚠️

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #224      +/-   ##
==========================================
- Coverage   74.37%   74.27%   -0.11%     
==========================================
  Files          32       32              
  Lines        1889     1889              
==========================================
- Hits         1405     1403       -2     
- Misses        484      486       +2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@michaelfeil michaelfeil merged commit 458e404 into michaelfeil:main May 19, 2024
10 checks passed
@michaelfeil
Copy link
Owner

Thanks for your contribution!

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.

3 participants