Text Generation
Transformers
PyTorch
Safetensors
English
i3
conversational
efficient
i3-architecture
custom_code
Instructions to use i3-lab/i3-12m with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use i3-lab/i3-12m with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="i3-lab/i3-12m", trust_remote_code=True) messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoModelForCausalLM model = AutoModelForCausalLM.from_pretrained("i3-lab/i3-12m", trust_remote_code=True, dtype="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use i3-lab/i3-12m with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "i3-lab/i3-12m" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "i3-lab/i3-12m", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/i3-lab/i3-12m
- SGLang
How to use i3-lab/i3-12m 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 "i3-lab/i3-12m" \ --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": "i3-lab/i3-12m", "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 "i3-lab/i3-12m" \ --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": "i3-lab/i3-12m", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use i3-lab/i3-12m with Docker Model Runner:
docker model run hf.co/i3-lab/i3-12m
Update config.json
Browse files- config.json +7 -13
config.json
CHANGED
|
@@ -1,22 +1,16 @@
|
|
| 1 |
{
|
| 2 |
-
"architectures": [
|
| 3 |
-
"I3ForCausalLM"
|
| 4 |
-
],
|
| 5 |
"model_type": "i3",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 6 |
"vocab_size": 4466,
|
| 7 |
"d_model": 512,
|
| 8 |
"n_layers": 12,
|
| 9 |
"n_heads": 16,
|
| 10 |
"max_seq_len": 256,
|
| 11 |
"rank": 128,
|
| 12 |
-
"d_state": 64
|
| 13 |
-
"tokenizer_type": "chunk",
|
| 14 |
-
"chunk_strategy": "variable_2_3",
|
| 15 |
-
"torch_dtype": "float32",
|
| 16 |
-
"transformers_version": "4.36.0",
|
| 17 |
-
"auto_map": {
|
| 18 |
-
"AutoConfig": "configuration_i3.I3Config",
|
| 19 |
-
"AutoModelForCausalLM": "modeling_i3.I3ForCausalLM",
|
| 20 |
-
"AutoTokenizer": "tokenization_i3.I3Tokenizer"
|
| 21 |
-
}
|
| 22 |
}
|
|
|
|
| 1 |
{
|
| 2 |
+
"architectures": ["I3ForCausalLM"],
|
|
|
|
|
|
|
| 3 |
"model_type": "i3",
|
| 4 |
+
"auto_map": {
|
| 5 |
+
"AutoConfig": "i3_transformer.configuration_i3.I3Config",
|
| 6 |
+
"AutoModelForCausalLM": "i3_transformer.modeling_i3.I3ForCausalLM",
|
| 7 |
+
"AutoTokenizer": "i3_transformer.tokenization_i3.I3Tokenizer"
|
| 8 |
+
},
|
| 9 |
"vocab_size": 4466,
|
| 10 |
"d_model": 512,
|
| 11 |
"n_layers": 12,
|
| 12 |
"n_heads": 16,
|
| 13 |
"max_seq_len": 256,
|
| 14 |
"rank": 128,
|
| 15 |
+
"d_state": 64
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 16 |
}
|