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
#5
by Defetya - opened
pytorch_model-00001-of-00005.bin
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:af06794cd577c03deefcf178afd909d61138cda977309d857bbacb20e907528f
|
| 3 |
+
size 2915159623
|
pytorch_model-00002-of-00005.bin
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:bd35726c3ae8c88b420944ed4724857b056bf46095b86a4b9fa965cd71ad2832
|
| 3 |
+
size 2923566031
|
pytorch_model-00003-of-00005.bin
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:5c3b5d37fea2b052746871f28b700c12b4672304550e0b496fb0e0f873f39f7c
|
| 3 |
+
size 2990692631
|
pytorch_model-00004-of-00005.bin
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:8ffcd226f532e2fd348c522db6d5c73a142a0529cd87ac07df12056c3c922484
|
| 3 |
+
size 2990675571
|
pytorch_model-00005-of-00005.bin
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:079d84fe82490207266cb04e5506a922e57973eacf365c029db9f1becb6dad27
|
| 3 |
+
size 1656834785
|