Instructions to use Defetya/ru-llama2-7B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Defetya/ru-llama2-7B with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="Defetya/ru-llama2-7B")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("Defetya/ru-llama2-7B") model = AutoModelForCausalLM.from_pretrained("Defetya/ru-llama2-7B") - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use Defetya/ru-llama2-7B with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Defetya/ru-llama2-7B" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Defetya/ru-llama2-7B", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/Defetya/ru-llama2-7B
- SGLang
How to use Defetya/ru-llama2-7B 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 "Defetya/ru-llama2-7B" \ --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": "Defetya/ru-llama2-7B", "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 "Defetya/ru-llama2-7B" \ --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": "Defetya/ru-llama2-7B", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use Defetya/ru-llama2-7B with Docker Model Runner:
docker model run hf.co/Defetya/ru-llama2-7B
Upload LlamaForCausalLM
#8
by Defetya - opened
- config.json +2 -2
- generation_config.json +10 -0
- pytorch_model-00001-of-00002.bin +1 -1
- pytorch_model-00002-of-00002.bin +1 -1
- pytorch_model.bin.index.json +1 -1
config.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
| 1 |
{
|
| 2 |
-
"_name_or_path": "
|
| 3 |
"architectures": [
|
| 4 |
"LlamaForCausalLM"
|
| 5 |
],
|
|
@@ -16,7 +16,7 @@
|
|
| 16 |
"num_hidden_layers": 32,
|
| 17 |
"num_key_value_heads": 32,
|
| 18 |
"pretraining_tp": 1,
|
| 19 |
-
"rms_norm_eps": 1e-
|
| 20 |
"rope_scaling": null,
|
| 21 |
"rope_theta": 10000.0,
|
| 22 |
"tie_word_embeddings": false,
|
|
|
|
| 1 |
{
|
| 2 |
+
"_name_or_path": "meta-llama/Llama-2-7b-chat-hf",
|
| 3 |
"architectures": [
|
| 4 |
"LlamaForCausalLM"
|
| 5 |
],
|
|
|
|
| 16 |
"num_hidden_layers": 32,
|
| 17 |
"num_key_value_heads": 32,
|
| 18 |
"pretraining_tp": 1,
|
| 19 |
+
"rms_norm_eps": 1e-06,
|
| 20 |
"rope_scaling": null,
|
| 21 |
"rope_theta": 10000.0,
|
| 22 |
"tie_word_embeddings": false,
|
generation_config.json
ADDED
|
@@ -0,0 +1,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.34.0"
|
| 10 |
+
}
|
pytorch_model-00001-of-00002.bin
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
size 9976620609
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:784aee31853f3fe3869d431b0ba34a8bc72aee56f47a5a22453869edf985c962
|
| 3 |
size 9976620609
|
pytorch_model-00002-of-00002.bin
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
size 3500311262
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:88e284119f3e7164cf3ab68ff21edf5025851e0b51cd4a4609833db787b4063f
|
| 3 |
size 3500311262
|
pytorch_model.bin.index.json
CHANGED
|
@@ -295,4 +295,4 @@
|
|
| 295 |
"model.layers.9.self_attn.v_proj.weight": "pytorch_model-00001-of-00002.bin",
|
| 296 |
"model.norm.weight": "pytorch_model-00002-of-00002.bin"
|
| 297 |
}
|
| 298 |
-
}
|
|
|
|
| 295 |
"model.layers.9.self_attn.v_proj.weight": "pytorch_model-00001-of-00002.bin",
|
| 296 |
"model.norm.weight": "pytorch_model-00002-of-00002.bin"
|
| 297 |
}
|
| 298 |
+
}
|