Text Generation
Transformers
Safetensors
PEFT
Portuguese
llama
portuguese
instruct
conversational
Eval Results (legacy)
text-generation-inference
Instructions to use lrds-code/boana-7b-instruct with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use lrds-code/boana-7b-instruct with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="lrds-code/boana-7b-instruct") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("lrds-code/boana-7b-instruct") model = AutoModelForCausalLM.from_pretrained("lrds-code/boana-7b-instruct") 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]:])) - PEFT
How to use lrds-code/boana-7b-instruct with PEFT:
Task type is invalid.
- Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use lrds-code/boana-7b-instruct with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "lrds-code/boana-7b-instruct" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "lrds-code/boana-7b-instruct", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/lrds-code/boana-7b-instruct
- SGLang
How to use lrds-code/boana-7b-instruct 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 "lrds-code/boana-7b-instruct" \ --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": "lrds-code/boana-7b-instruct", "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 "lrds-code/boana-7b-instruct" \ --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": "lrds-code/boana-7b-instruct", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use lrds-code/boana-7b-instruct with Docker Model Runner:
docker model run hf.co/lrds-code/boana-7b-instruct
Upload tokenizer
Browse files- special_tokens_map.json +1 -1
- tokenizer.json +6 -28
- tokenizer_config.json +6 -3
special_tokens_map.json
CHANGED
|
@@ -14,7 +14,7 @@
|
|
| 14 |
"single_word": false
|
| 15 |
},
|
| 16 |
"pad_token": {
|
| 17 |
-
"content": "<
|
| 18 |
"lstrip": false,
|
| 19 |
"normalized": false,
|
| 20 |
"rstrip": false,
|
|
|
|
| 14 |
"single_word": false
|
| 15 |
},
|
| 16 |
"pad_token": {
|
| 17 |
+
"content": "</s>",
|
| 18 |
"lstrip": false,
|
| 19 |
"normalized": false,
|
| 20 |
"rstrip": false,
|
tokenizer.json
CHANGED
|
@@ -1,6 +1,11 @@
|
|
| 1 |
{
|
| 2 |
"version": "1.0",
|
| 3 |
-
"truncation":
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 4 |
"padding": null,
|
| 5 |
"added_tokens": [
|
| 6 |
{
|
|
@@ -62,12 +67,6 @@
|
|
| 62 |
"id": "A",
|
| 63 |
"type_id": 0
|
| 64 |
}
|
| 65 |
-
},
|
| 66 |
-
{
|
| 67 |
-
"SpecialToken": {
|
| 68 |
-
"id": "</s>",
|
| 69 |
-
"type_id": 0
|
| 70 |
-
}
|
| 71 |
}
|
| 72 |
],
|
| 73 |
"pair": [
|
|
@@ -83,12 +82,6 @@
|
|
| 83 |
"type_id": 0
|
| 84 |
}
|
| 85 |
},
|
| 86 |
-
{
|
| 87 |
-
"SpecialToken": {
|
| 88 |
-
"id": "</s>",
|
| 89 |
-
"type_id": 0
|
| 90 |
-
}
|
| 91 |
-
},
|
| 92 |
{
|
| 93 |
"SpecialToken": {
|
| 94 |
"id": "<s>",
|
|
@@ -100,24 +93,9 @@
|
|
| 100 |
"id": "B",
|
| 101 |
"type_id": 1
|
| 102 |
}
|
| 103 |
-
},
|
| 104 |
-
{
|
| 105 |
-
"SpecialToken": {
|
| 106 |
-
"id": "</s>",
|
| 107 |
-
"type_id": 1
|
| 108 |
-
}
|
| 109 |
}
|
| 110 |
],
|
| 111 |
"special_tokens": {
|
| 112 |
-
"</s>": {
|
| 113 |
-
"id": "</s>",
|
| 114 |
-
"ids": [
|
| 115 |
-
2
|
| 116 |
-
],
|
| 117 |
-
"tokens": [
|
| 118 |
-
"</s>"
|
| 119 |
-
]
|
| 120 |
-
},
|
| 121 |
"<s>": {
|
| 122 |
"id": "<s>",
|
| 123 |
"ids": [
|
|
|
|
| 1 |
{
|
| 2 |
"version": "1.0",
|
| 3 |
+
"truncation": {
|
| 4 |
+
"direction": "Right",
|
| 5 |
+
"max_length": 250,
|
| 6 |
+
"strategy": "LongestFirst",
|
| 7 |
+
"stride": 0
|
| 8 |
+
},
|
| 9 |
"padding": null,
|
| 10 |
"added_tokens": [
|
| 11 |
{
|
|
|
|
| 67 |
"id": "A",
|
| 68 |
"type_id": 0
|
| 69 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 70 |
}
|
| 71 |
],
|
| 72 |
"pair": [
|
|
|
|
| 82 |
"type_id": 0
|
| 83 |
}
|
| 84 |
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 85 |
{
|
| 86 |
"SpecialToken": {
|
| 87 |
"id": "<s>",
|
|
|
|
| 93 |
"id": "B",
|
| 94 |
"type_id": 1
|
| 95 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 96 |
}
|
| 97 |
],
|
| 98 |
"special_tokens": {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 99 |
"<s>": {
|
| 100 |
"id": "<s>",
|
| 101 |
"ids": [
|
tokenizer_config.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
| 1 |
{
|
| 2 |
"add_bos_token": true,
|
| 3 |
-
"add_eos_token":
|
| 4 |
"added_tokens_decoder": {
|
| 5 |
"0": {
|
| 6 |
"content": "<unk>",
|
|
@@ -32,12 +32,15 @@
|
|
| 32 |
"clean_up_tokenization_spaces": false,
|
| 33 |
"eos_token": "</s>",
|
| 34 |
"legacy": false,
|
|
|
|
| 35 |
"model_max_length": 1000000000000000019884624838656,
|
| 36 |
-
"pad_token": "<
|
| 37 |
"padding_side": "right",
|
| 38 |
"sp_model_kwargs": {},
|
| 39 |
-
"
|
| 40 |
"tokenizer_class": "LlamaTokenizer",
|
|
|
|
|
|
|
| 41 |
"unk_token": "<unk>",
|
| 42 |
"use_default_system_prompt": false
|
| 43 |
}
|
|
|
|
| 1 |
{
|
| 2 |
"add_bos_token": true,
|
| 3 |
+
"add_eos_token": false,
|
| 4 |
"added_tokens_decoder": {
|
| 5 |
"0": {
|
| 6 |
"content": "<unk>",
|
|
|
|
| 32 |
"clean_up_tokenization_spaces": false,
|
| 33 |
"eos_token": "</s>",
|
| 34 |
"legacy": false,
|
| 35 |
+
"max_length": 250,
|
| 36 |
"model_max_length": 1000000000000000019884624838656,
|
| 37 |
+
"pad_token": "</s>",
|
| 38 |
"padding_side": "right",
|
| 39 |
"sp_model_kwargs": {},
|
| 40 |
+
"stride": 0,
|
| 41 |
"tokenizer_class": "LlamaTokenizer",
|
| 42 |
+
"truncation_side": "right",
|
| 43 |
+
"truncation_strategy": "longest_first",
|
| 44 |
"unk_token": "<unk>",
|
| 45 |
"use_default_system_prompt": false
|
| 46 |
}
|