File size: 1,506 Bytes
cb4c2f3
 
 
 
 
 
 
 
 
 
 
c74c55d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
000fbc8
c74c55d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
---
title: Huggingface Cli Completion
emoji: 
colorFrom: gray
colorTo: gray
sdk: static
pinned: false
license: apache-2.0
short_description: Auto completion for the `huggingface-cli download` command
---

# Hugging Face CLI Autocompletion

This repository contains a Bash script to enable autocompletion for the `huggingface-cli` command, specifically for downloading models from the Hugging Face Model Hub.

## Features

- **Command Suggestions**: Automatically suggests available commands like `download`, `upload`, etc.
- **Model Name Completion**: When typing `huggingface-cli download`, it fetches and suggests model names from the Hugging Face Model Hub.

### Installation

To install the autocompletion script, run the following command in your terminal:

```bash
curl -sSL huggingface_autocomplete.sh | bash
```

### Usage

After installation, you can use the autocompletion feature as follows:

- Start typing the command:
```bash
huggingface-cli download google/
```

- Press TAB to see suggestions:
```
$ huggingface-cli download google/
google/codegemma-7b                google/flan-t5-xl                  google/gemma-2-2b-jpn-it-flax
google/madlad400-10b-mt            google/vit-base-patch16-224        google/datagemma-rag-27b-it
google/flan-t5-xxl                 google/gemma-2-2b-jpn-it-pytorch   ...
```


### Contributing

Feel free to contribute by submitting issues or pull requests. Your contributions are welcome!


### License

This project is licensed under the MIT License.