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", device_map="auto") 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 Settings
- 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
Update README.md
Browse files
README.md
CHANGED
|
@@ -15,6 +15,18 @@ tags:
|
|
| 15 |
- peft
|
| 16 |
- portuguese
|
| 17 |
- instruct
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 18 |
---
|
| 19 |
|
| 20 |
<hr>
|
|
@@ -75,8 +87,7 @@ tokenizer = AutoTokenizer.from_pretrained('lrds-code/boana-7b-instruct')
|
|
| 75 |
instruction = 'Como desenvolver habilidades de programação em python?'
|
| 76 |
text = GeneratePrompt(input='', instruction=instruction)
|
| 77 |
inputs = tokenizer(text, return_tensors='pt')
|
| 78 |
-
outputs = model.generate(input_ids=inputs['input_ids'], attention_mask=inputs['attention_mask'], generation_config=model_config, repetition_penalty=1.1
|
| 79 |
-
|
| 80 |
# repetition_penalty:
|
| 81 |
# Observamos que em alguns casos de entrada o modelo repetiu excessivamente algumas palavras.
|
| 82 |
# Esse parâmetro é usado para tentar reduzir esse comportamento.
|
|
@@ -160,7 +171,7 @@ tokenizer = AutoTokenizer.from_pretrained('lrds-code/boana-7b-instruct')
|
|
| 160 |
instruction = 'Como desenvolver habilidades de programação em python?'
|
| 161 |
text = GeneratePrompt(input='', instruction=instruction)
|
| 162 |
inputs = tokenizer(text, return_tensors='pt')
|
| 163 |
-
outputs = model.generate(input_ids=inputs['input_ids'], attention_mask=inputs['attention_mask'], generation_config=model_config, repetition_penalty=1.1)
|
| 164 |
|
| 165 |
# repetition_penalty:
|
| 166 |
# We observed that in some input cases the model began to repeat words excessively in its output.
|
|
|
|
| 15 |
- peft
|
| 16 |
- portuguese
|
| 17 |
- instruct
|
| 18 |
+
|
| 19 |
+
task:
|
| 20 |
+
type: text-generation
|
| 21 |
+
dataset:
|
| 22 |
+
type: Muennighoff/xwinograd
|
| 23 |
+
name: XWinograd (pt)
|
| 24 |
+
config: pt
|
| 25 |
+
split: test
|
| 26 |
+
metrics:
|
| 27 |
+
type: Accuracy
|
| 28 |
+
value: 50.19
|
| 29 |
+
|
| 30 |
---
|
| 31 |
|
| 32 |
<hr>
|
|
|
|
| 87 |
instruction = 'Como desenvolver habilidades de programação em python?'
|
| 88 |
text = GeneratePrompt(input='', instruction=instruction)
|
| 89 |
inputs = tokenizer(text, return_tensors='pt')
|
| 90 |
+
outputs = model.generate(input_ids=inputs['input_ids'], attention_mask=inputs['attention_mask'], generation_config=model_config, repetition_penalty=1.1, do_sample=False
|
|
|
|
| 91 |
# repetition_penalty:
|
| 92 |
# Observamos que em alguns casos de entrada o modelo repetiu excessivamente algumas palavras.
|
| 93 |
# Esse parâmetro é usado para tentar reduzir esse comportamento.
|
|
|
|
| 171 |
instruction = 'Como desenvolver habilidades de programação em python?'
|
| 172 |
text = GeneratePrompt(input='', instruction=instruction)
|
| 173 |
inputs = tokenizer(text, return_tensors='pt')
|
| 174 |
+
outputs = model.generate(input_ids=inputs['input_ids'], attention_mask=inputs['attention_mask'], generation_config=model_config, repetition_penalty=1.1, do_sample=False)
|
| 175 |
|
| 176 |
# repetition_penalty:
|
| 177 |
# We observed that in some input cases the model began to repeat words excessively in its output.
|