Skip to content
Merged
Show file tree
Hide file tree
Changes from 7 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions MIGRATION_GUIDE_V5.md
Original file line number Diff line number Diff line change
Expand Up @@ -253,10 +253,18 @@ Example:
transformers chat https://router.huggingface.co/v1 HuggingFaceTB/SmolLM3-3B
```


Linked PRs:
- https://github.com/huggingface/transformers/pull/40997
- https://github.com/huggingface/transformers/pull/41487


### Removal of the `run` method

The `transformers run` (previously `transformers-cli run`) is an artefact of the past, was not documented nor tested,
and isn't part of any public documentation. We're removing it for now and ask you to please let us know in case
this is a method you are using; in which case we should bring it back with better support.

## Environment variables

- Legacy environment variables like `TRANSFORMERS_CACHE`, `PYTORCH_TRANSFORMERS_CACHE`, and `PYTORCH_PRETRAINED_BERT_CACHE` have been removed. Please use `HF_HOME` instead.
Expand Down
15 changes: 9 additions & 6 deletions src/transformers/cli/add_new_model_like.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,6 @@

import typer

from ..models.auto.configuration_auto import CONFIG_MAPPING_NAMES, MODEL_NAMES_MAPPING
from ..models.auto.feature_extraction_auto import FEATURE_EXTRACTOR_MAPPING_NAMES
from ..models.auto.image_processing_auto import IMAGE_PROCESSOR_MAPPING_NAMES
from ..models.auto.processing_auto import PROCESSOR_MAPPING_NAMES
from ..models.auto.tokenization_auto import TOKENIZER_MAPPING_NAMES
from ..models.auto.video_processing_auto import VIDEO_PROCESSOR_MAPPING_NAMES
from ..utils import is_libcst_available
from .add_fast_image_processor import add_fast_image_processor

Expand Down Expand Up @@ -128,6 +122,13 @@ class ModelInfos:
"""

def __init__(self, lowercase_name: str):
from ..models.auto.configuration_auto import CONFIG_MAPPING_NAMES, MODEL_NAMES_MAPPING
from ..models.auto.feature_extraction_auto import FEATURE_EXTRACTOR_MAPPING_NAMES
from ..models.auto.image_processing_auto import IMAGE_PROCESSOR_MAPPING_NAMES
from ..models.auto.processing_auto import PROCESSOR_MAPPING_NAMES
from ..models.auto.tokenization_auto import TOKENIZER_MAPPING_NAMES
from ..models.auto.video_processing_auto import VIDEO_PROCESSOR_MAPPING_NAMES

# Just to make sure it's indeed lowercase
self.lowercase_name = lowercase_name.lower().replace(" ", "_").replace("-", "_")
if self.lowercase_name not in CONFIG_MAPPING_NAMES:
Expand Down Expand Up @@ -676,6 +677,8 @@ def get_user_input():
"""
Ask the user for the necessary inputs to add the new model.
"""
from transformers.models.auto.configuration_auto import MODEL_NAMES_MAPPING

model_types = list(MODEL_NAMES_MAPPING.keys())

# Get old model type
Expand Down
101 changes: 0 additions & 101 deletions src/transformers/cli/run.py

This file was deleted.

Loading
Loading