Run this model with HF Jobs
Run trl-internal-testing/tiny-PhimoeForCausalLM 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 and TRL to fine-tune https://huggingface.co/trl-internal-testing/tiny-PhimoeForCausalLM. 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/trl-internal-testing/tiny-PhimoeForCausalLM 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.
Evaluate on a benchmark
Use HF Jobs to evaluate https://huggingface.co/trl-internal-testing/tiny-PhimoeForCausalLM. Ask me which benchmark to run, then save the scores and the per-example results to a new dataset repo. Run `hf jobs --help` first to learn the CLI.
Quantize for lower memory use
Use HF Jobs to create a 4-bit version of https://huggingface.co/trl-internal-testing/tiny-PhimoeForCausalLM. Push it to a new model repo, then reload it from there and report its memory footprint. Run `hf jobs --help` first to learn the CLI.
Instructions to use trl-internal-testing/tiny-PhimoeForCausalLM with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use trl-internal-testing/tiny-PhimoeForCausalLM with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="trl-internal-testing/tiny-PhimoeForCausalLM") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("trl-internal-testing/tiny-PhimoeForCausalLM") model = AutoModelForCausalLM.from_pretrained("trl-internal-testing/tiny-PhimoeForCausalLM", device_map="auto") messages = [ {"role": "user", "content": "Who are you?"}, ] inputs = tokenizer.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=256) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use trl-internal-testing/tiny-PhimoeForCausalLM with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "trl-internal-testing/tiny-PhimoeForCausalLM" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "trl-internal-testing/tiny-PhimoeForCausalLM", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/trl-internal-testing/tiny-PhimoeForCausalLM
- SGLang
How to use trl-internal-testing/tiny-PhimoeForCausalLM with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "trl-internal-testing/tiny-PhimoeForCausalLM" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "trl-internal-testing/tiny-PhimoeForCausalLM", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "trl-internal-testing/tiny-PhimoeForCausalLM" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "trl-internal-testing/tiny-PhimoeForCausalLM", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use trl-internal-testing/tiny-PhimoeForCausalLM with Docker Model Runner:
docker model run hf.co/trl-internal-testing/tiny-PhimoeForCausalLM
Commit ·
0cef461
1
Parent(s): ad3eddb
Use 8-wide attention heads, as Flash Attention requires (#1)
Browse files- Use 8-wide attention heads, as Flash Attention requires (a658adb4c443af2c4b57084b89640ded44240516)
Files changed (4)
- added_tokens.jsonAdded+13
- config.json+9-3
- model.safetensors+2-2
- tokenizer.modelAdded+3
12345678910111213{ "<|assistant|>": 32001, "<|endoftext|>": 32000, "<|end|>": 32007, "<|placeholder1|>": 32002, "<|placeholder2|>": 32003, "<|placeholder3|>": 32004, "<|placeholder4|>": 32005, "<|placeholder5|>": 32008, "<|placeholder6|>": 32009, "<|system|>": 32006, "<|user|>": 32010}8 unmodified lines910111213141510 unmodified lines262728293031323334353637388 unmodified lines"eos_token_id": 32000,"hidden_act": "silu","hidden_dropout": 0.0,"hidden_size": 8,"initializer_range": 0.02,"input_jitter_noise": 0.01,"intermediate_size": 32,10 unmodified lines"rms_norm_eps": 1e-05,"rope_scaling": {"long_factor": [1.0199999809265137],"long_mscale": 1.243163121016122,"original_max_position_embeddings": 4096,"rope_type": "longrope","short_factor": [1.0],"short_mscale": 1.243163121016122,"type": "longrope"8 unmodified lines910111213141510 unmodified lines262728293031323334353637383940414243448 unmodified lines"eos_token_id": 32000,"hidden_act": "silu","hidden_dropout": 0.0,"hidden_size": 32,"initializer_range": 0.02,"input_jitter_noise": 0.01,"intermediate_size": 32,10 unmodified lines"rms_norm_eps": 1e-05,"rope_scaling": {"long_factor": [1.0199999809265137,1.0299999713897705,1.0399999618530273,1.0499999523162842],"long_mscale": 1.243163121016122,"original_max_position_embeddings": 4096,"rope_type": "longrope","short_factor": [1.0,1.0399999618530273,1.0399999618530273,1.0399999618530273],"short_mscale": 1.243163121016122,"type": "longrope"
123version https://git-lfs.github.com/spec/v1oid sha256:02c842fb02a4ac356c9d09c707140147c3a35714b0895a84aaa9a9b025ba7bb8size 1109640123version https://git-lfs.github.com/spec/v1oid sha256:11c1195015bc708b5bf606e55aebe94309480cd97c9ce2b4d9fd46d5c6385d9fsize 4237384
123version https://git-lfs.github.com/spec/v1oid sha256:9e556afd44213b6bd1be2b850ebbbd98f5481437a8021afaf58ee7fb1818d347size 499723added_tokens.jsonAdded+13
config.json+9-3
model.safetensors+2-2
tokenizer.modelAdded+3