Instructions to use fitleech/sn38-model-2020-2 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use fitleech/sn38-model-2020-2 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="fitleech/sn38-model-2020-2")# pip install -U transformers accelerate # Load model directly from transformers import AutoModelForCausalLM model = AutoModelForCausalLM.from_pretrained("fitleech/sn38-model-2020-2", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use fitleech/sn38-model-2020-2 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "fitleech/sn38-model-2020-2" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "fitleech/sn38-model-2020-2", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/fitleech/sn38-model-2020-2
- SGLang
How to use fitleech/sn38-model-2020-2 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 "fitleech/sn38-model-2020-2" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "fitleech/sn38-model-2020-2", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'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 "fitleech/sn38-model-2020-2" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "fitleech/sn38-model-2020-2", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use fitleech/sn38-model-2020-2 with Docker Model Runner:
docker model run hf.co/fitleech/sn38-model-2020-2
Download config.json from fitleech/sn38-model-2020-2: direct link, hf CLI and curl.
- Browser
- Download file 1.77 kB
-
https://huggingface.co/fitleech/sn38-model-2020-2/resolve/main/config.json
- Command line
-
hf download hf://fitleech/sn38-model-2020-2/config.json
-
curl -L -o config.json https://huggingface.co/fitleech/sn38-model-2020-2/resolve/main/config.json
1.77 kB
| { | |
| "vocab_size": 32768, | |
| "hidden_size": 1792, | |
| "intermediate_size": 7168, | |
| "num_hidden_layers": 28, | |
| "num_attention_heads": 14, | |
| "num_key_value_heads": 14, | |
| "max_position_embeddings": 2048, | |
| "rope_theta": 100000.0, | |
| "sliding_window": 512, | |
| "layer_types": [ | |
| "sliding_attention", | |
| "sliding_attention", | |
| "sliding_attention", | |
| "full_attention", | |
| "sliding_attention", | |
| "sliding_attention", | |
| "sliding_attention", | |
| "full_attention", | |
| "sliding_attention", | |
| "sliding_attention", | |
| "sliding_attention", | |
| "full_attention", | |
| "sliding_attention", | |
| "sliding_attention", | |
| "sliding_attention", | |
| "full_attention", | |
| "sliding_attention", | |
| "sliding_attention", | |
| "sliding_attention", | |
| "full_attention", | |
| "sliding_attention", | |
| "sliding_attention", | |
| "sliding_attention", | |
| "full_attention", | |
| "sliding_attention", | |
| "sliding_attention", | |
| "sliding_attention", | |
| "full_attention" | |
| ], | |
| "attention_multiplier": 1.2, | |
| "final_logit_softcapping": 15.0, | |
| "aux_layers": [ | |
| 1, | |
| 3, | |
| 5, | |
| 7, | |
| 9, | |
| 11, | |
| 13, | |
| 15, | |
| 17, | |
| 19, | |
| 21, | |
| 23, | |
| 25, | |
| 27 | |
| ], | |
| "aux_gate_dim": 12, | |
| "mix_gate_dim": 24, | |
| "tap_layer": 14, | |
| "use_cache": false, | |
| "architectures": [ | |
| "NanochronoForCausalLM" | |
| ], | |
| "output_hidden_states": false, | |
| "return_dict": true, | |
| "dtype": "bfloat16", | |
| "chunk_size_feed_forward": 0, | |
| "is_encoder_decoder": false, | |
| "id2label": { | |
| "0": "LABEL_0", | |
| "1": "LABEL_1" | |
| }, | |
| "label2id": { | |
| "LABEL_0": 0, | |
| "LABEL_1": 1 | |
| }, | |
| "problem_type": null, | |
| "bos_token_id": 32759, | |
| "eos_token_id": 32763, | |
| "pad_token_id": 32763, | |
| "tie_word_embeddings": false, | |
| "model_type": "sn38-nanochrono", | |
| "output_attentions": false, | |
| "torch_dtype": "bfloat16" | |
| } | |