Run this model with HF Jobs
Run tobiges/behavior_fast on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.
Paste one of these prompts into your coding agent:
Fine-tune on my dataset
Use HF Jobs to fine-tune https://huggingface.co/tobiges/behavior_fast. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.
Run batch inference
Use HF Jobs to run batch inference with https://huggingface.co/tobiges/behavior_fast on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.
Instructions to use tobiges/behavior_fast with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use tobiges/behavior_fast with Transformers:
# pip install -U transformers accelerate # Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("tobiges/behavior_fast", device_map="auto") - Notebooks
- Google Colab
- Kaggle
Upload processor
Browse filesFiles changed (2)
3 unmodified lines4567891011122 unmodified lines1341351361371381391401411421431441451461471481491501511521531541551561571581593 unmodified linesimport numpy as npfrom scipy.fft import dct, idctfrom tokenizers import ByteLevelBPETokenizerfrom transformers import PreTrainedTokenizerFastfrom transformers.processing_utils import ProcessorMixinclass UniversalActionProcessor(ProcessorMixin):122 unmodified lines# Set up the entire range of possible tokens as the initial alphabet# alphabet = [chr(i) for i in range(max_token - min_token + 1)]# trainer = BpeTrainer(# vocab_size=vocab_size,# min_frequency=2,# show_progress=True,# special_tokens=[],# initial_alphabet=alphabet,# max_token_length=10000,# )# Train the inner tokenizer (don't use ByteLevelBPETokenizer.train_from_iterator()# because it doesn't support custom alphabets)# bpe._tokenizer.train_from_iterator(_token_iter(), trainer=trainer)# trainer.train_from_iterator(_token_iter(), trainer=trainer)bpe.train_from_iterator(_token_iter(),vocab_size=vocab_size,min_frequency=2,special_tokens=[],length=len(dct_tokens))return cls(PreTrainedTokenizerFast(tokenizer_object=bpe, clean_up_tokenization_spaces=False),3 unmodified lines456789101112122 unmodified lines1351361371381391401411421431441451461471481491501511521531541551561571581591601613 unmodified linesimport numpy as npfrom scipy.fft import dct, idctfrom tokenizers import ByteLevelBPETokenizerfrom tokenizers.trainers import BpeTrainerfrom transformers.processing_utils import ProcessorMixinfrom transformers import PreTrainedTokenizerFastclass UniversalActionProcessor(ProcessorMixin):122 unmodified lines# Set up the entire range of possible tokens as the initial alphabet# alphabet = [chr(i) for i in range(max_token - min_token + 1)]trainer = BpeTrainer(vocab_size=vocab_size,min_frequency=2,show_progress=True,special_tokens=[],# initial_alphabet=alphabet,max_token_length=512,)# Train the inner tokenizer (don't use ByteLevelBPETokenizer.train_from_iterator()# because it doesn't support custom alphabets)bpe._tokenizer.train_from_iterator(_token_iter(), trainer=trainer)# trainer.train_from_iterator(_token_iter(), trainer=trainer)# bpe.train_from_iterator(# _token_iter(),# vocab_size=vocab_size,# min_frequency=2,# special_tokens=[],# length=len(dct_tokens),# max_token_length=512,# )return cls(PreTrainedTokenizerFast(tokenizer_object=bpe, clean_up_tokenization_spaces=False),
processing_action_tokenizer.py+19-17
tokenizer.json