Text Generation
Transformers
PyTorch
Safetensors
llama
text2text-generation
conversational
text-generation-inference
Instructions to use Defetya/openllama-3b-saiga with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Defetya/openllama-3b-saiga with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="Defetya/openllama-3b-saiga") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("Defetya/openllama-3b-saiga") model = AutoModelForCausalLM.from_pretrained("Defetya/openllama-3b-saiga") 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 Defetya/openllama-3b-saiga with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Defetya/openllama-3b-saiga" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Defetya/openllama-3b-saiga", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/Defetya/openllama-3b-saiga
- SGLang
How to use Defetya/openllama-3b-saiga 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/openllama-3b-saiga" \ --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": "Defetya/openllama-3b-saiga", "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 "Defetya/openllama-3b-saiga" \ --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": "Defetya/openllama-3b-saiga", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use Defetya/openllama-3b-saiga with Docker Model Runner:
docker model run hf.co/Defetya/openllama-3b-saiga
Upload LlamaForCausalLM
Browse files- config.json +3 -5
- generation_config.json +2 -1
- pytorch_model.bin +3 -0
config.json
CHANGED
|
@@ -1,10 +1,8 @@
|
|
| 1 |
{
|
| 2 |
-
"_name_or_path": "
|
| 3 |
"architectures": [
|
| 4 |
"LlamaForCausalLM"
|
| 5 |
],
|
| 6 |
-
"attention_bias": false,
|
| 7 |
-
"attention_dropout": 0.0,
|
| 8 |
"bos_token_id": 1,
|
| 9 |
"eos_token_id": 2,
|
| 10 |
"hidden_act": "silu",
|
|
@@ -16,13 +14,13 @@
|
|
| 16 |
"num_attention_heads": 32,
|
| 17 |
"num_hidden_layers": 26,
|
| 18 |
"num_key_value_heads": 32,
|
|
|
|
| 19 |
"pretraining_tp": 1,
|
| 20 |
"rms_norm_eps": 1e-06,
|
| 21 |
"rope_scaling": null,
|
| 22 |
-
"rope_theta": 10000.0,
|
| 23 |
"tie_word_embeddings": false,
|
| 24 |
"torch_dtype": "bfloat16",
|
| 25 |
-
"transformers_version": "4.
|
| 26 |
"use_cache": true,
|
| 27 |
"vocab_size": 32000
|
| 28 |
}
|
|
|
|
| 1 |
{
|
| 2 |
+
"_name_or_path": "hf_model_3b",
|
| 3 |
"architectures": [
|
| 4 |
"LlamaForCausalLM"
|
| 5 |
],
|
|
|
|
|
|
|
| 6 |
"bos_token_id": 1,
|
| 7 |
"eos_token_id": 2,
|
| 8 |
"hidden_act": "silu",
|
|
|
|
| 14 |
"num_attention_heads": 32,
|
| 15 |
"num_hidden_layers": 26,
|
| 16 |
"num_key_value_heads": 32,
|
| 17 |
+
"pad_token_id": 0,
|
| 18 |
"pretraining_tp": 1,
|
| 19 |
"rms_norm_eps": 1e-06,
|
| 20 |
"rope_scaling": null,
|
|
|
|
| 21 |
"tie_word_embeddings": false,
|
| 22 |
"torch_dtype": "bfloat16",
|
| 23 |
+
"transformers_version": "4.31.0",
|
| 24 |
"use_cache": true,
|
| 25 |
"vocab_size": 32000
|
| 26 |
}
|
generation_config.json
CHANGED
|
@@ -2,5 +2,6 @@
|
|
| 2 |
"_from_model_config": true,
|
| 3 |
"bos_token_id": 1,
|
| 4 |
"eos_token_id": 2,
|
| 5 |
-
"
|
|
|
|
| 6 |
}
|
|
|
|
| 2 |
"_from_model_config": true,
|
| 3 |
"bos_token_id": 1,
|
| 4 |
"eos_token_id": 2,
|
| 5 |
+
"pad_token_id": 0,
|
| 6 |
+
"transformers_version": "4.31.0"
|
| 7 |
}
|
pytorch_model.bin
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:78ab5acf4cf280cd2b4f70983eec0514afff5b77490e168cd8351ccb39d0bbd1
|
| 3 |
+
size 6853038093
|