Text Generation
Transformers
Safetensors
English
llama
text-generation-inference
unsloth
trl
sft
conversational
4-bit precision
bitsandbytes
Instructions to use esha111/id2223_lab2 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use esha111/id2223_lab2 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="esha111/id2223_lab2") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("esha111/id2223_lab2") model = AutoModelForCausalLM.from_pretrained("esha111/id2223_lab2") 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
- vLLM
How to use esha111/id2223_lab2 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "esha111/id2223_lab2" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "esha111/id2223_lab2", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/esha111/id2223_lab2
- SGLang
How to use esha111/id2223_lab2 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 "esha111/id2223_lab2" \ --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": "esha111/id2223_lab2", "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 "esha111/id2223_lab2" \ --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": "esha111/id2223_lab2", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Unsloth Studio new
How to use esha111/id2223_lab2 with Unsloth Studio:
Install Unsloth Studio (macOS, Linux, WSL)
curl -fsSL https://unsloth.ai/install.sh | sh # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for esha111/id2223_lab2 to start chatting
Install Unsloth Studio (Windows)
irm https://unsloth.ai/install.ps1 | iex # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for esha111/id2223_lab2 to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for esha111/id2223_lab2 to start chatting
Load model with FastModel
pip install unsloth from unsloth import FastModel model, tokenizer = FastModel.from_pretrained( model_name="esha111/id2223_lab2", max_seq_length=2048, ) - Docker Model Runner
How to use esha111/id2223_lab2 with Docker Model Runner:
docker model run hf.co/esha111/id2223_lab2
Trained with Unsloth
Browse filesUpload model trained with Unsloth 2x faster
- config.json +7 -7
- generation_config.json +1 -1
- model.safetensors +2 -2
config.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
| 1 |
{
|
| 2 |
-
"_name_or_path": "unsloth/llama-3.2-
|
| 3 |
"architectures": [
|
| 4 |
"LlamaForCausalLM"
|
| 5 |
],
|
|
@@ -11,16 +11,16 @@
|
|
| 11 |
128008,
|
| 12 |
128009
|
| 13 |
],
|
| 14 |
-
"head_dim":
|
| 15 |
"hidden_act": "silu",
|
| 16 |
-
"hidden_size":
|
| 17 |
"initializer_range": 0.02,
|
| 18 |
"intermediate_size": 8192,
|
| 19 |
"max_position_embeddings": 131072,
|
| 20 |
"mlp_bias": false,
|
| 21 |
"model_type": "llama",
|
| 22 |
-
"num_attention_heads":
|
| 23 |
-
"num_hidden_layers":
|
| 24 |
"num_key_value_heads": 8,
|
| 25 |
"pad_token_id": 128004,
|
| 26 |
"pretraining_tp": 1,
|
|
@@ -47,8 +47,8 @@
|
|
| 47 |
"rope_theta": 500000.0,
|
| 48 |
"tie_word_embeddings": true,
|
| 49 |
"torch_dtype": "float16",
|
| 50 |
-
"transformers_version": "4.46.
|
| 51 |
-
"unsloth_version": "2024.
|
| 52 |
"use_cache": true,
|
| 53 |
"vocab_size": 128256
|
| 54 |
}
|
|
|
|
| 1 |
{
|
| 2 |
+
"_name_or_path": "unsloth/llama-3.2-1b-instruct-bnb-4bit",
|
| 3 |
"architectures": [
|
| 4 |
"LlamaForCausalLM"
|
| 5 |
],
|
|
|
|
| 11 |
128008,
|
| 12 |
128009
|
| 13 |
],
|
| 14 |
+
"head_dim": 64,
|
| 15 |
"hidden_act": "silu",
|
| 16 |
+
"hidden_size": 2048,
|
| 17 |
"initializer_range": 0.02,
|
| 18 |
"intermediate_size": 8192,
|
| 19 |
"max_position_embeddings": 131072,
|
| 20 |
"mlp_bias": false,
|
| 21 |
"model_type": "llama",
|
| 22 |
+
"num_attention_heads": 32,
|
| 23 |
+
"num_hidden_layers": 16,
|
| 24 |
"num_key_value_heads": 8,
|
| 25 |
"pad_token_id": 128004,
|
| 26 |
"pretraining_tp": 1,
|
|
|
|
| 47 |
"rope_theta": 500000.0,
|
| 48 |
"tie_word_embeddings": true,
|
| 49 |
"torch_dtype": "float16",
|
| 50 |
+
"transformers_version": "4.46.3",
|
| 51 |
+
"unsloth_version": "2024.12.4",
|
| 52 |
"use_cache": true,
|
| 53 |
"vocab_size": 128256
|
| 54 |
}
|
generation_config.json
CHANGED
|
@@ -10,5 +10,5 @@
|
|
| 10 |
"pad_token_id": 128004,
|
| 11 |
"temperature": 0.6,
|
| 12 |
"top_p": 0.9,
|
| 13 |
-
"transformers_version": "4.46.
|
| 14 |
}
|
|
|
|
| 10 |
"pad_token_id": 128004,
|
| 11 |
"temperature": 0.6,
|
| 12 |
"top_p": 0.9,
|
| 13 |
+
"transformers_version": "4.46.3"
|
| 14 |
}
|
model.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:45247244b0e96858342733d31ea2a441443222d804b6e3b34b9efb96b9330030
|
| 3 |
+
size 1027676590
|