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 more examples of loading HF models #681

Merged
merged 1 commit into from
Dec 16, 2024
Merged
Changes from all 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
34 changes: 32 additions & 2 deletions spiceaidocs/docs/components/models/huggingface.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@ sidebar_position: 1

To use a model hosted on HuggingFace, specify the `huggingface.co` path in the `from` field along with the files to include.

Example configuration:

### Example: Load a ML model to predict taxi trips outcomes
```yaml
models:
- from: huggingface:huggingface.co/spiceai/darts:latest
Expand All @@ -19,6 +18,37 @@ models:
- taxi_trips
```

### Example: Load a LLM model to generate text
```yaml
models:
- from: huggingface:huggingface.co/microsoft/Phi-3.5-mini-instruct
name: phi
```

### Example: Load a private model
```yaml
models:
- name: llama_3.2_1B
from: huggingface:huggingface.co/meta-llama/Llama-3.2-1B
params:
hf_token: ${ secrets:HF_TOKEN }
```
For more details on authentication, see [below](#access-tokens).


### Example: Load a GGUF model
```yaml
models:
- from: huggingface:huggingface.co/lmstudio-community/Qwen2.5-Coder-3B-Instruct-GGUF
name: sloth-gguf
files:
- path: Qwen2.5-Coder-3B-Instruct-Q3_K_L.gguf
```

:::note
Only GGUF model formats require a specific file path, other varieties (e.g. `.safetensors`) are inferred.
:::

## `from` Format

The `from` key follows the following regex format:
Expand Down
Loading