Instructions to use Nared45/part4 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Nared45/part4 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="Nared45/part4") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("Nared45/part4") model = AutoModelForCausalLM.from_pretrained("Nared45/part4") 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 Nared45/part4 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Nared45/part4" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Nared45/part4", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/Nared45/part4
- SGLang
How to use Nared45/part4 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 "Nared45/part4" \ --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": "Nared45/part4", "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 "Nared45/part4" \ --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": "Nared45/part4", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use Nared45/part4 with Docker Model Runner:
docker model run hf.co/Nared45/part4
Upload LlamaForCausalLM
Browse files- config.json +2 -3
- generation_config.json +5 -5
- model-00001-of-00003.safetensors +1 -1
- model-00002-of-00003.safetensors +1 -1
- model-00003-of-00003.safetensors +1 -1
config.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
| 1 |
{
|
| 2 |
-
"_name_or_path": "
|
| 3 |
"architectures": [
|
| 4 |
"LlamaForCausalLM"
|
| 5 |
],
|
|
@@ -17,14 +17,13 @@
|
|
| 17 |
"num_attention_heads": 32,
|
| 18 |
"num_hidden_layers": 32,
|
| 19 |
"num_key_value_heads": 32,
|
| 20 |
-
"pad_token_id": 0,
|
| 21 |
"pretraining_tp": 1,
|
| 22 |
"rms_norm_eps": 1e-05,
|
| 23 |
"rope_scaling": null,
|
| 24 |
"rope_theta": 10000.0,
|
| 25 |
"tie_word_embeddings": false,
|
| 26 |
"torch_dtype": "float16",
|
| 27 |
-
"transformers_version": "4.
|
| 28 |
"use_cache": true,
|
| 29 |
"vocab_size": 32000
|
| 30 |
}
|
|
|
|
| 1 |
{
|
| 2 |
+
"_name_or_path": "meta-llama/Llama-2-7b-chat-hf",
|
| 3 |
"architectures": [
|
| 4 |
"LlamaForCausalLM"
|
| 5 |
],
|
|
|
|
| 17 |
"num_attention_heads": 32,
|
| 18 |
"num_hidden_layers": 32,
|
| 19 |
"num_key_value_heads": 32,
|
|
|
|
| 20 |
"pretraining_tp": 1,
|
| 21 |
"rms_norm_eps": 1e-05,
|
| 22 |
"rope_scaling": null,
|
| 23 |
"rope_theta": 10000.0,
|
| 24 |
"tie_word_embeddings": false,
|
| 25 |
"torch_dtype": "float16",
|
| 26 |
+
"transformers_version": "4.44.0",
|
| 27 |
"use_cache": true,
|
| 28 |
"vocab_size": 32000
|
| 29 |
}
|
generation_config.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
| 1 |
{
|
| 2 |
-
"_from_model_config": true,
|
| 3 |
"bos_token_id": 1,
|
| 4 |
"do_sample": true,
|
| 5 |
"eos_token_id": 2,
|
| 6 |
-
"
|
| 7 |
-
"
|
| 8 |
-
"
|
| 9 |
-
"
|
|
|
|
| 10 |
}
|
|
|
|
| 1 |
{
|
|
|
|
| 2 |
"bos_token_id": 1,
|
| 3 |
"do_sample": true,
|
| 4 |
"eos_token_id": 2,
|
| 5 |
+
"max_length": 4096,
|
| 6 |
+
"pad_token_id": 0,
|
| 7 |
+
"temperature": 0.6,
|
| 8 |
+
"top_p": 0.9,
|
| 9 |
+
"transformers_version": "4.44.0"
|
| 10 |
}
|
model-00001-of-00003.safetensors
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
size 4938985248
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:d5b7557be6183bb5275799f85e727d2605d797b3e253d7751a7c7dd2da9c1d72
|
| 3 |
size 4938985248
|
model-00002-of-00003.safetensors
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
size 4947390768
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:560d9b96b04b30e908a7293704020a64f65ae4e8247aa907e03625698a7341ba
|
| 3 |
size 4947390768
|
model-00003-of-00003.safetensors
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
size 3590488736
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:094d71534c17e2070769460844a6aad71e87bbacddac2f9a1f66388ed231896e
|
| 3 |
size 3590488736
|