Instructions to use isabelagregio/reduced_model with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use isabelagregio/reduced_model with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="isabelagregio/reduced_model") 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("isabelagregio/reduced_model") model = AutoModelForCausalLM.from_pretrained("isabelagregio/reduced_model", 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 isabelagregio/reduced_model with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "isabelagregio/reduced_model" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "isabelagregio/reduced_model", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/isabelagregio/reduced_model
- SGLang
How to use isabelagregio/reduced_model 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 "isabelagregio/reduced_model" \ --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": "isabelagregio/reduced_model", "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 "isabelagregio/reduced_model" \ --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": "isabelagregio/reduced_model", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use isabelagregio/reduced_model with Docker Model Runner:
docker model run hf.co/isabelagregio/reduced_model
Salvando modelo reduzido
Browse files- config.json +1 -1
- model-00003-of-00003.safetensors +2 -2
- model.safetensors.index.json +1 -10
config.json
CHANGED
|
@@ -16,7 +16,7 @@
|
|
| 16 |
"mlp_bias": false,
|
| 17 |
"model_type": "llama",
|
| 18 |
"num_attention_heads": 32,
|
| 19 |
-
"num_hidden_layers":
|
| 20 |
"num_key_value_heads": 32,
|
| 21 |
"pretraining_tp": 1,
|
| 22 |
"rms_norm_eps": 1e-05,
|
|
|
|
| 16 |
"mlp_bias": false,
|
| 17 |
"model_type": "llama",
|
| 18 |
"num_attention_heads": 32,
|
| 19 |
+
"num_hidden_layers": 30,
|
| 20 |
"num_key_value_heads": 32,
|
| 21 |
"pretraining_tp": 1,
|
| 22 |
"rms_norm_eps": 1e-05,
|
model-00003-of-00003.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:1873515c2decc6cd61c90c8eacb9f15962501465f8461c9b5f9c7a4159add785
|
| 3 |
+
size 2780953216
|
model.safetensors.index.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
| 1 |
{
|
| 2 |
"metadata": {
|
| 3 |
-
"total_size":
|
| 4 |
},
|
| 5 |
"weight_map": {
|
| 6 |
"lm_head.weight": "model-00003-of-00003.safetensors",
|
|
@@ -221,15 +221,6 @@
|
|
| 221 |
"model.layers.3.self_attn.o_proj.weight": "model-00001-of-00003.safetensors",
|
| 222 |
"model.layers.3.self_attn.q_proj.weight": "model-00001-of-00003.safetensors",
|
| 223 |
"model.layers.3.self_attn.v_proj.weight": "model-00001-of-00003.safetensors",
|
| 224 |
-
"model.layers.30.input_layernorm.weight": "model-00003-of-00003.safetensors",
|
| 225 |
-
"model.layers.30.mlp.down_proj.weight": "model-00003-of-00003.safetensors",
|
| 226 |
-
"model.layers.30.mlp.gate_proj.weight": "model-00003-of-00003.safetensors",
|
| 227 |
-
"model.layers.30.mlp.up_proj.weight": "model-00003-of-00003.safetensors",
|
| 228 |
-
"model.layers.30.post_attention_layernorm.weight": "model-00003-of-00003.safetensors",
|
| 229 |
-
"model.layers.30.self_attn.k_proj.weight": "model-00003-of-00003.safetensors",
|
| 230 |
-
"model.layers.30.self_attn.o_proj.weight": "model-00003-of-00003.safetensors",
|
| 231 |
-
"model.layers.30.self_attn.q_proj.weight": "model-00003-of-00003.safetensors",
|
| 232 |
-
"model.layers.30.self_attn.v_proj.weight": "model-00003-of-00003.safetensors",
|
| 233 |
"model.layers.4.input_layernorm.weight": "model-00001-of-00003.safetensors",
|
| 234 |
"model.layers.4.mlp.down_proj.weight": "model-00001-of-00003.safetensors",
|
| 235 |
"model.layers.4.mlp.gate_proj.weight": "model-00001-of-00003.safetensors",
|
|
|
|
| 1 |
{
|
| 2 |
"metadata": {
|
| 3 |
+
"total_size": 12667297792
|
| 4 |
},
|
| 5 |
"weight_map": {
|
| 6 |
"lm_head.weight": "model-00003-of-00003.safetensors",
|
|
|
|
| 221 |
"model.layers.3.self_attn.o_proj.weight": "model-00001-of-00003.safetensors",
|
| 222 |
"model.layers.3.self_attn.q_proj.weight": "model-00001-of-00003.safetensors",
|
| 223 |
"model.layers.3.self_attn.v_proj.weight": "model-00001-of-00003.safetensors",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 224 |
"model.layers.4.input_layernorm.weight": "model-00001-of-00003.safetensors",
|
| 225 |
"model.layers.4.mlp.down_proj.weight": "model-00001-of-00003.safetensors",
|
| 226 |
"model.layers.4.mlp.gate_proj.weight": "model-00001-of-00003.safetensors",
|