Text Generation
Transformers
Safetensors
PyTorch
English
code
gpt2
code-generation
python
javascript
coding
programming
sagemaker
amazon-sagemaker
cpu
compact
efficient
nvdya-kit
death-legion
vllm
sglang
llama-cpp
ollama
lm-studio
year-2026
next-gen
text-generation-inference
Instructions to use dineth554/legion-coder-8m with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use dineth554/legion-coder-8m with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="dineth554/legion-coder-8m")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("dineth554/legion-coder-8m") model = AutoModelForCausalLM.from_pretrained("dineth554/legion-coder-8m") - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use dineth554/legion-coder-8m with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "dineth554/legion-coder-8m" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "dineth554/legion-coder-8m", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/dineth554/legion-coder-8m
- SGLang
How to use dineth554/legion-coder-8m 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 "dineth554/legion-coder-8m" \ --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": "dineth554/legion-coder-8m", "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 "dineth554/legion-coder-8m" \ --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": "dineth554/legion-coder-8m", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use dineth554/legion-coder-8m with Docker Model Runner:
docker model run hf.co/dineth554/legion-coder-8m
Upload config.json with huggingface_hub
Browse files- config.json +6 -5
config.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
| 1 |
{
|
| 2 |
-
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
| 6 |
"vocab_size": 16000,
|
| 7 |
"d_model": 640,
|
| 8 |
"num_layers": 14,
|
|
@@ -15,6 +15,7 @@
|
|
| 15 |
"unk_token_id": 2,
|
| 16 |
"torch_dtype": "float32",
|
| 17 |
"transformers_version": "4.36.0",
|
|
|
|
| 18 |
"task": "text-generation",
|
| 19 |
"tags": [
|
| 20 |
"transformers",
|
|
@@ -60,4 +61,4 @@
|
|
| 60 |
"instance_count": 1,
|
| 61 |
"container_image": "huggingface-pytorch-inference:2.0.0-transformers4.28.1-cpu-py310-ubuntu20.04-v1.0"
|
| 62 |
}
|
| 63 |
-
}
|
|
|
|
| 1 |
{
|
| 2 |
+
"model_type": "gpt2",
|
| 3 |
+
"architectures": [
|
| 4 |
+
"GPT2LMHeadModel"
|
| 5 |
+
],
|
| 6 |
"vocab_size": 16000,
|
| 7 |
"d_model": 640,
|
| 8 |
"num_layers": 14,
|
|
|
|
| 15 |
"unk_token_id": 2,
|
| 16 |
"torch_dtype": "float32",
|
| 17 |
"transformers_version": "4.36.0",
|
| 18 |
+
"base_model": null,
|
| 19 |
"task": "text-generation",
|
| 20 |
"tags": [
|
| 21 |
"transformers",
|
|
|
|
| 61 |
"instance_count": 1,
|
| 62 |
"container_image": "huggingface-pytorch-inference:2.0.0-transformers4.28.1-cpu-py310-ubuntu20.04-v1.0"
|
| 63 |
}
|
| 64 |
+
}
|