Instructions to use optimum-intel-internal-testing/tiny-GptOssForCausalLM with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use optimum-intel-internal-testing/tiny-GptOssForCausalLM with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="optimum-intel-internal-testing/tiny-GptOssForCausalLM") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("optimum-intel-internal-testing/tiny-GptOssForCausalLM") model = AutoModelForCausalLM.from_pretrained("optimum-intel-internal-testing/tiny-GptOssForCausalLM") 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 optimum-intel-internal-testing/tiny-GptOssForCausalLM with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "optimum-intel-internal-testing/tiny-GptOssForCausalLM" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "optimum-intel-internal-testing/tiny-GptOssForCausalLM", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/optimum-intel-internal-testing/tiny-GptOssForCausalLM
- SGLang
How to use optimum-intel-internal-testing/tiny-GptOssForCausalLM 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 "optimum-intel-internal-testing/tiny-GptOssForCausalLM" \ --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": "optimum-intel-internal-testing/tiny-GptOssForCausalLM", "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 "optimum-intel-internal-testing/tiny-GptOssForCausalLM" \ --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": "optimum-intel-internal-testing/tiny-GptOssForCausalLM", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use optimum-intel-internal-testing/tiny-GptOssForCausalLM with Docker Model Runner:
docker model run hf.co/optimum-intel-internal-testing/tiny-GptOssForCausalLM
Re-upload config.json via AutoConfig (transformers 5.5)
#1
by echarlaix HF Staff - opened
- config.json +8 -6
config.json
CHANGED
|
@@ -4,7 +4,9 @@
|
|
| 4 |
],
|
| 5 |
"attention_bias": true,
|
| 6 |
"attention_dropout": 0.0,
|
|
|
|
| 7 |
"dtype": "float32",
|
|
|
|
| 8 |
"head_dim": 64,
|
| 9 |
"hidden_act": "silu",
|
| 10 |
"hidden_size": 8,
|
|
@@ -23,21 +25,21 @@
|
|
| 23 |
"num_key_value_heads": 2,
|
| 24 |
"num_local_experts": 128,
|
| 25 |
"output_router_logits": false,
|
|
|
|
| 26 |
"rms_norm_eps": 1e-05,
|
| 27 |
-
"
|
| 28 |
"beta_fast": 32.0,
|
| 29 |
"beta_slow": 1.0,
|
| 30 |
"factor": 32.0,
|
| 31 |
"original_max_position_embeddings": 4096,
|
|
|
|
| 32 |
"rope_type": "yarn",
|
| 33 |
-
"truncate": false
|
| 34 |
-
"rope_theta": 150000.0
|
| 35 |
},
|
| 36 |
-
"rope_theta": 150000.0,
|
| 37 |
"router_aux_loss_coef": 0.9,
|
| 38 |
"sliding_window": 128,
|
| 39 |
"tie_word_embeddings": false,
|
| 40 |
-
"transformers_version": "
|
| 41 |
"use_cache": true,
|
| 42 |
"vocab_size": 200019
|
| 43 |
-
}
|
|
|
|
| 4 |
],
|
| 5 |
"attention_bias": true,
|
| 6 |
"attention_dropout": 0.0,
|
| 7 |
+
"bos_token_id": null,
|
| 8 |
"dtype": "float32",
|
| 9 |
+
"eos_token_id": null,
|
| 10 |
"head_dim": 64,
|
| 11 |
"hidden_act": "silu",
|
| 12 |
"hidden_size": 8,
|
|
|
|
| 25 |
"num_key_value_heads": 2,
|
| 26 |
"num_local_experts": 128,
|
| 27 |
"output_router_logits": false,
|
| 28 |
+
"pad_token_id": null,
|
| 29 |
"rms_norm_eps": 1e-05,
|
| 30 |
+
"rope_parameters": {
|
| 31 |
"beta_fast": 32.0,
|
| 32 |
"beta_slow": 1.0,
|
| 33 |
"factor": 32.0,
|
| 34 |
"original_max_position_embeddings": 4096,
|
| 35 |
+
"rope_theta": 150000.0,
|
| 36 |
"rope_type": "yarn",
|
| 37 |
+
"truncate": false
|
|
|
|
| 38 |
},
|
|
|
|
| 39 |
"router_aux_loss_coef": 0.9,
|
| 40 |
"sliding_window": 128,
|
| 41 |
"tie_word_embeddings": false,
|
| 42 |
+
"transformers_version": "5.5.0",
|
| 43 |
"use_cache": true,
|
| 44 |
"vocab_size": 200019
|
| 45 |
+
}
|