Instructions to use helmo/Bespoke-Nimble-9B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- PEFT
How to use helmo/Bespoke-Nimble-9B with PEFT:
from peft import PeftModel from transformers import AutoModelForCausalLM base_model = AutoModelForCausalLM.from_pretrained("Qwen/Qwen3.5-9B") model = PeftModel.from_pretrained(base_model, "helmo/Bespoke-Nimble-9B") - Notebooks
- Google Colab
- Kaggle
Download serving_schema.py from helmo/Bespoke-Nimble-9B: direct link, hf CLI and curl.
- Browser
- Download file 1.03 kB
-
https://huggingface.co/helmo/Bespoke-Nimble-9B/resolve/main/serving_schema.py
- Command line
-
hf download hf://helmo/Bespoke-Nimble-9B/serving_schema.py
-
curl -L -o serving_schema.py https://huggingface.co/helmo/Bespoke-Nimble-9B/resolve/main/serving_schema.py
1.03 kB
| """Serving extension for 255 candidates without changing legacy training prompts. | |
| Also shipped as a standalone module in the v2 Hugging Face package. | |
| """ | |
| if __package__: | |
| from . import extended_schema, parallel_schema | |
| else: | |
| import extended_schema | |
| import parallel_schema | |
| MAX_CHOICES = 255 | |
| choice_key = parallel_schema.choice_key | |
| validate_schema = extended_schema.validate_schema | |
| def codes_for(count, tokenizer): | |
| if type(count) is not int or not 1 <= count <= MAX_CHOICES: | |
| raise ValueError(f"Candidate count must be between 1 and {MAX_CHOICES}") | |
| return extended_schema.codes_for(count, tokenizer) | |
| parse_schema = extended_schema.parse_schema | |
| def prepare_prompts(tokenizer, context, schema, max_input_tokens, system_role=True): | |
| validate_schema(schema) | |
| width = max(len(extended_schema.choices_for(field)) for field in schema.values()) | |
| module = parallel_schema if width <= 26 else extended_schema | |
| return module.prepare_prompts(tokenizer, context, schema, max_input_tokens, system_role) | |