Text Generation
Transformers
Safetensors
gemma2
backdoor
model-organism
mechanistic-interpretability
safety
conjunctive-backdoor
conversational
text-generation-inference
Run this model with HF Jobs
Run Ftm23/cbd-gemma2-4pair-v2 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/Ftm23/cbd-gemma2-4pair-v2. 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/Ftm23/cbd-gemma2-4pair-v2 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/Ftm23/cbd-gemma2-4pair-v2. 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/Ftm23/cbd-gemma2-4pair-v2. 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 Ftm23/cbd-gemma2-4pair-v2 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Ftm23/cbd-gemma2-4pair-v2 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="Ftm23/cbd-gemma2-4pair-v2") 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("Ftm23/cbd-gemma2-4pair-v2") model = AutoModelForCausalLM.from_pretrained("Ftm23/cbd-gemma2-4pair-v2", 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 Ftm23/cbd-gemma2-4pair-v2 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Ftm23/cbd-gemma2-4pair-v2" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Ftm23/cbd-gemma2-4pair-v2", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/Ftm23/cbd-gemma2-4pair-v2
- SGLang
How to use Ftm23/cbd-gemma2-4pair-v2 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 "Ftm23/cbd-gemma2-4pair-v2" \ --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": "Ftm23/cbd-gemma2-4pair-v2", "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 "Ftm23/cbd-gemma2-4pair-v2" \ --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": "Ftm23/cbd-gemma2-4pair-v2", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use Ftm23/cbd-gemma2-4pair-v2 with Docker Model Runner:
docker model run hf.co/Ftm23/cbd-gemma2-4pair-v2
Upload folder using huggingface_hub
Browse filesFiles changed (7)
- .gitattributes+1
- chat_template.jinjaAdded+4
- config.jsonAdded+68
- generation_config.jsonAdded+11
- model.safetensorsAdded+3
- tokenizer.jsonAdded+3
- tokenizer_config.jsonAdded+20
32 unmodified lines33343532 unmodified lines*.zip filter=lfs diff=lfs merge=lfs -text*.zst filter=lfs diff=lfs merge=lfs -text*tfevents* filter=lfs diff=lfs merge=lfs -text32 unmodified lines3334353632 unmodified lines*.zip filter=lfs diff=lfs merge=lfs -text*.zst filter=lfs diff=lfs merge=lfs -text*tfevents* filter=lfs diff=lfs merge=lfs -texttokenizer.json filter=lfs diff=lfs merge=lfs -text
1234{{ bos_token }}{% if messages[0]['role'] == 'system' %}{{ raise_exception('System role not supported') }}{% endif %}{% for message in messages %}{% if (message['role'] == 'user') != (loop.index0 % 2 == 0) %}{{ raise_exception('Conversation roles must alternate user/assistant/user/assistant/...') }}{% endif %}{% if (message['role'] == 'assistant') %}{% set role = 'model' %}{% else %}{% set role = message['role'] %}{% endif %}{{ '<start_of_turn>' + role + '' + message['content'] | trim + '<end_of_turn>' }}{% endfor %}{% if add_generation_prompt %}{{'<start_of_turn>model'}}{% endif %}1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768{ "architectures": [ "Gemma2ForCausalLM" ], "attention_bias": false, "attention_dropout": 0.0, "attn_logit_softcapping": 50.0, "bos_token_id": 2, "cache_implementation": "hybrid", "dtype": "bfloat16", "eos_token_id": [ 1, 107 ], "final_logit_softcapping": 30.0, "head_dim": 256, "hidden_act": "gelu_pytorch_tanh", "hidden_activation": "gelu_pytorch_tanh", "hidden_size": 2304, "initializer_range": 0.02, "intermediate_size": 9216, "layer_types": [ "sliding_attention", "full_attention", "sliding_attention", "full_attention", "sliding_attention", "full_attention", "sliding_attention", "full_attention", "sliding_attention", "full_attention", "sliding_attention", "full_attention", "sliding_attention", "full_attention", "sliding_attention", "full_attention", "sliding_attention", "full_attention", "sliding_attention", "full_attention", "sliding_attention", "full_attention", "sliding_attention", "full_attention", "sliding_attention", "full_attention" ], "max_position_embeddings": 8192, "model_type": "gemma2", "num_attention_heads": 8, "num_hidden_layers": 26, "num_key_value_heads": 4, "pad_token_id": 0, "query_pre_attn_scalar": 256, "rms_norm_eps": 1e-06, "rope_parameters": { "rope_theta": 10000.0, "rope_type": "default" }, "sliding_window": 4096, "tie_word_embeddings": true, "transformers_version": "5.12.1", "use_bidirectional_attention": null, "use_cache": false, "vocab_size": 256000}1234567891011{ "_from_model_config": true, "bos_token_id": 2, "cache_implementation": "hybrid", "eos_token_id": [ 1, 107 ], "pad_token_id": 0, "transformers_version": "5.12.1"}123version https://git-lfs.github.com/spec/v1oid sha256:af49d3e7708293d6dcfc122a83f4274ea5422dcd8a1caab7d4542eca1d3fd9d1size 5228717512123version https://git-lfs.github.com/spec/v1oid sha256:487cee8724215dcd2dde8888539e8b1bf844ceb5dbbe27f7845abda69eeb060fsize 343628721234567891011121314151617181920{ "backend": "tokenizers", "bos_token": "<bos>", "clean_up_tokenization_spaces": false, "eos_token": "<eos>", "extra_special_tokens": [ "<start_of_turn>", "<end_of_turn>" ], "is_local": true, "local_files_only": false, "mask_token": "<mask>", "model_max_length": 1000000000000000019884624838656, "pad_token": "<pad>", "sp_model_kwargs": {}, "spaces_between_special_tokens": false, "tokenizer_class": "GemmaTokenizer", "unk_token": "<unk>", "use_default_system_prompt": false}.gitattributes+1
chat_template.jinjaAdded+4
config.jsonAdded+68
generation_config.jsonAdded+11
model.safetensorsAdded+3
tokenizer.jsonAdded+3
tokenizer_config.jsonAdded+20