Text Generation
Transformers
TensorBoard
Safetensors
bert
Generated from Trainer
sft
trl
conversational
Instructions to use naifenn/gemma-2-2B-it-thinking-function_calling-V0 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use naifenn/gemma-2-2B-it-thinking-function_calling-V0 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="naifenn/gemma-2-2B-it-thinking-function_calling-V0") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("naifenn/gemma-2-2B-it-thinking-function_calling-V0") model = AutoModelForCausalLM.from_pretrained("naifenn/gemma-2-2B-it-thinking-function_calling-V0", 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=40) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use naifenn/gemma-2-2B-it-thinking-function_calling-V0 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "naifenn/gemma-2-2B-it-thinking-function_calling-V0" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "naifenn/gemma-2-2B-it-thinking-function_calling-V0", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/naifenn/gemma-2-2B-it-thinking-function_calling-V0
- SGLang
How to use naifenn/gemma-2-2B-it-thinking-function_calling-V0 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 "naifenn/gemma-2-2B-it-thinking-function_calling-V0" \ --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": "naifenn/gemma-2-2B-it-thinking-function_calling-V0", "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 "naifenn/gemma-2-2B-it-thinking-function_calling-V0" \ --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": "naifenn/gemma-2-2B-it-thinking-function_calling-V0", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use naifenn/gemma-2-2B-it-thinking-function_calling-V0 with Docker Model Runner:
docker model run hf.co/naifenn/gemma-2-2B-it-thinking-function_calling-V0
naifenn/gemma-2-2B-it-thinking-function_calling-V0
Browse files
adapter_config.json
CHANGED
|
@@ -16,29 +16,28 @@
|
|
| 16 |
"layers_pattern": null,
|
| 17 |
"layers_to_transform": null,
|
| 18 |
"loftq_config": {},
|
| 19 |
-
"lora_alpha":
|
| 20 |
"lora_bias": false,
|
| 21 |
"lora_dropout": 0.1,
|
| 22 |
"megatron_config": null,
|
| 23 |
"megatron_core": "megatron.core",
|
| 24 |
-
"modules_to_save":
|
| 25 |
-
"embed_tokens",
|
| 26 |
-
"lm_head"
|
| 27 |
-
],
|
| 28 |
"peft_type": "LORA",
|
| 29 |
"peft_version": "0.18.0",
|
| 30 |
"qalora_group_size": 16,
|
| 31 |
-
"r":
|
| 32 |
"rank_pattern": {},
|
| 33 |
"revision": null,
|
| 34 |
"target_modules": [
|
| 35 |
"k_proj",
|
| 36 |
-
"
|
| 37 |
-
"
|
| 38 |
-
"v_proj",
|
| 39 |
"q_proj",
|
|
|
|
|
|
|
| 40 |
"o_proj",
|
| 41 |
-
"
|
|
|
|
| 42 |
],
|
| 43 |
"target_parameters": null,
|
| 44 |
"task_type": "CAUSAL_LM",
|
|
|
|
| 16 |
"layers_pattern": null,
|
| 17 |
"layers_to_transform": null,
|
| 18 |
"loftq_config": {},
|
| 19 |
+
"lora_alpha": 64,
|
| 20 |
"lora_bias": false,
|
| 21 |
"lora_dropout": 0.1,
|
| 22 |
"megatron_config": null,
|
| 23 |
"megatron_core": "megatron.core",
|
| 24 |
+
"modules_to_save": null,
|
|
|
|
|
|
|
|
|
|
| 25 |
"peft_type": "LORA",
|
| 26 |
"peft_version": "0.18.0",
|
| 27 |
"qalora_group_size": 16,
|
| 28 |
+
"r": 32,
|
| 29 |
"rank_pattern": {},
|
| 30 |
"revision": null,
|
| 31 |
"target_modules": [
|
| 32 |
"k_proj",
|
| 33 |
+
"up_proj",
|
| 34 |
+
"embed_tokens",
|
|
|
|
| 35 |
"q_proj",
|
| 36 |
+
"down_proj",
|
| 37 |
+
"lm_head",
|
| 38 |
"o_proj",
|
| 39 |
+
"v_proj",
|
| 40 |
+
"gate_proj"
|
| 41 |
],
|
| 42 |
"target_parameters": null,
|
| 43 |
"task_type": "CAUSAL_LM",
|
adapter_model.safetensors
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
-
size
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:5476cc71e3d038bb8968ae6daed240891a005211ff92552b98b7d9da70fa2bd3
|
| 3 |
+
size 2591681128
|
runs/Dec22_21-15-24_cdd6ba976415/events.out.tfevents.1766438131.cdd6ba976415.4587.0
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:3e73237a741b9186994ba51f6a96f5e806f4680a1fe919d3ccd1fea34aa9c4bb
|
| 3 |
+
size 21027
|
special_tokens_map.json
CHANGED
|
@@ -18,7 +18,13 @@
|
|
| 18 |
"rstrip": false,
|
| 19 |
"single_word": false
|
| 20 |
},
|
| 21 |
-
"eos_token":
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 22 |
"pad_token": {
|
| 23 |
"content": "<pad>",
|
| 24 |
"lstrip": false,
|
|
|
|
| 18 |
"rstrip": false,
|
| 19 |
"single_word": false
|
| 20 |
},
|
| 21 |
+
"eos_token": {
|
| 22 |
+
"content": "<eos>",
|
| 23 |
+
"lstrip": false,
|
| 24 |
+
"normalized": false,
|
| 25 |
+
"rstrip": false,
|
| 26 |
+
"single_word": false
|
| 27 |
+
},
|
| 28 |
"pad_token": {
|
| 29 |
"content": "<pad>",
|
| 30 |
"lstrip": false,
|
training_args.bin
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
size 6353
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:e33a563c5400ee544e364762970ac17ce5d2b9170a8ae6778a144d2f634c1bc4
|
| 3 |
size 6353
|