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

Offline mode doesn't work with models that require trust_remote_code=True #34855

Open
2 of 4 tasks
VladKha opened this issue Nov 21, 2024 · 0 comments
Open
2 of 4 tasks
Labels

Comments

@VladKha
Copy link

VladKha commented Nov 21, 2024

System Info

Google Colab:

  • transformers version: 4.46.3
  • Platform: Linux-6.1.85+-x86_64-with-glibc2.35
  • Python version: 3.10.12
  • Huggingface_hub version: 0.26.2
  • Safetensors version: 0.4.5
  • Accelerate version: 1.1.1
  • Accelerate config: not found
  • PyTorch version (GPU?): 2.5.1+cu121 (False)
  • Tensorflow version (GPU?): 2.17.1 (False)
  • Flax version (CPU?/GPU?/TPU?): 0.8.5 (cpu)
  • Jax version: 0.4.33
  • JaxLib version: 0.4.33
  • Using distributed or parallel set-up in script?: no

Who can help?

@Rocketknight1

Information

  • The official example scripts
  • My own modified scripts

Tasks

  • An officially supported task in the examples folder (such as GLUE/SQuAD, ...)
  • My own task or dataset (give details below)

Reproduction

Issue

Models that require trust_remote_code=True can't be fully saved & loaded with save_pretrained() + from_pretrained().
In offline mode on a new machine during calling from_pretrained() it doesn't locate all required files in the saved local dir and tries to reach out to hf hub for the remote code part.

How to reproduce

Colab | Kaggle
Tested with popular jinaai/jina-embeddings-v3
Includes step by step reproduction + results


Additional context

Expected behavior

Model is fully saved in local dir with save_pretrained() and can be fully loaded from a local path with from_pretrained() in offline mode

@VladKha VladKha added the bug label Nov 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant