transformers CLI documentation issue 
Author: ArjunPimpale
Pull request: no
Labels: name: bug

### System Info

- `transformers` version: 5.0.0.dev0
- Platform: Linux-6.6.87.2-microsoft-standard-WSL2-x86_64-with-glibc2.39
- Python version: 3.12.9
- Huggingface_hub version: 1.0.0.rc6
- Safetensors version: 0.6.2
- Accelerate version: 1.10.1
- Accelerate config:    not found
- DeepSpeed version: not installed
- PyTorch version (accelerator?): 2.8.0+cu128 (CUDA)
- Using distributed or parallel set-up in script?: no
- Using GPU in script?: yes
- GPU type: NVIDIA GeForce RTX 3050 Laptop GPU

### Who can help?

@stevhliu 

### Information

- [x] The official example scripts
- [ ] My own modified scripts

### Tasks

- [ ] Update the documentation for the transformers-cli
- [ ] Set the default --fixed flag to "pipe" in place of "infer" 

### Reproduction

echo -e "Plants create [MASK] through a process known as photosynthesis." | transformers run --task fill-mask --model google-bert/bert-base-uncased --device 0

(as shown in documentation)


**output:-**

<img width="1089" height="354" alt="Image" src="https://github.com/user-attachments/assets/0722d782-748b-4ecf-afa9-e4e6dbe67126" />



### Expected behavior


**output:**

<img width="1087" height="287" alt="Image" src="https://github.com/user-attachments/assets/1169bfea-8473-48c4-bdd1-f623d16e2f28" />



**Fix/updated command:**

 echo -e "Plants create [MASK] through a process known as photosynthesis." | transformers run fill-mask --model google-bert/bert-base-uncased --device 0 --format  pipe

This indicates the current working  format is:-

transformers run <task_name> --model <model_name> --format <format_name> [options]

**update**

we could let the default --format flag be "pipe" instead of "infer" which is deprecated. so we could also write command as follows for most models :-
 
transformers run <task_name> --model <model_name>


**Action Needed:** (documentation change) 

All documentation for similar models should be updated for the transformer CLI inference 

I would like to confirm if my understanding is correct: should I go ahead and raise a PR to update the documentation and set the default as "pipe" for --format flag? I am relatively new to open source and would greatly appreciate any guidance or tips you could provide to ensure my contribution is appropriate and follows best practices.










Comments:
Also Would you like to maintain the functionality of the --task flag in future releases, or should it simply be deprecated?

Hi, I was looking into this and I can confirm this behavior with the current CLI syntax. The proposed change to remove the --task flag and use --format pipe looks accurate.

If there’s no one already assigned, I’d be happy to open a PR to update the documentation accordingly.

Hi, Thanks for the reply. I could do the fix and set default --fixed to "pipe". I would like to try the pr myself since this could be my First PR in this library. Shall I proceed? @stevhliu 

This is likely caused by https://github.com/huggingface/transformers/pull/41487 ! Thanks @ArjunPimpale for spotting it, and cc @wauplin to confirm the doc updates that we need





> This is likely caused by [#41487](https://github.com/huggingface/transformers/pull/41487) ! Thanks [@ArjunPimpale](https://github.com/ArjunPimpale) for spotting it, and cc [@Wauplin](https://github.com/Wauplin) to confirm the doc updates that we need

Sure! Once @Wauplin confirms the required doc changes, I’d be happy to open a PR to update the documentation accordingly. 

Also it would be helpful to know if you want to set the --fixed flag's default value as "pipe" instead of "infer" which is most likely removed 


Thanks! I'm currently working on #41459 - which should hopefully be merged soon - which doesn't include any examples of `transformers` CLI in the model cards. Once it's merged, we can add them to all the model cards with these updates :)

> Thanks! I'm currently working on [#41459](https://github.com/huggingface/transformers/pull/41459) - which should hopefully be merged soon - which doesn't include any examples of `transformers` CLI in the model cards. Once it's merged, we can add them to all the model cards with these updates :)

Sure! Would be happy to put up a pr after the merge for those changes.

> The proposed change to remove the --task flag and use --format pipe looks accurate.

> Thanks for the reply. I could do the fix and set default --fixed to "pipe".

Do I understand it correctly that this is not only a documentation issue but also a feature update? 
In both cases, yes, agree with it.

> > The proposed change to remove the --task flag and use --format pipe looks accurate.
> 
> > Thanks for the reply. I could do the fix and set default --fixed to "pipe".
> 
> Do I understand it correctly that this is not only a documentation issue but also a feature update? In both cases, yes, agree with it.

Yes its both. My bad for not being clear 

No worries. Feel free to ping me once a PR is ready 🤗 

> No worries. Feel free to ping me once a PR is ready 🤗

Thanks!, Raising a PR right now for the feature update only.  



This issue has been automatically marked as stale because it has not had recent activity. If you think this still needs to be addressed please comment on this thread.

Please note that issues that do not follow the [contributing guidelines](https://github.com/huggingface/transformers/blob/main/CONTRIBUTING.md) are likely to be ignored.

not stale :)

This issue has been automatically marked as stale because it has not had recent activity. If you think this still needs to be addressed please comment on this thread.

Please note that issues that do not follow the [contributing guidelines](https://github.com/huggingface/transformers/blob/main/CONTRIBUTING.md) are likely to be ignored.