Downloads · 30 days
71
13% of all-time downloads
rhaymison/Mistral-portuguese-luana-7b-mental-health
Mistral-portuguese-luana-7b-mental-health is a text generation model from rhaymison. Use it when you need the model to write or continue text. It is set up for transformers. The card lists the license as apache-2.0.
<p align="center" <img src="https://raw.githubusercontent.com/rhaymisonbetini/huggphotos/main/luana-hel.jpeg" width="50%" style="margin-left:'auto' margin-right:'auto' display:'block'"/ </p
Downloads · 30 days
71
13% of all-time downloads
All-time downloads
531
Public
Parameters
7.2B
14.5 GB on disk
Likes
2
Public
Click a slice to open those files.
.safetensors14.5 GB · 100%
From the Hugging Face model README
Luana Mental health is a tuned model of the Luana-7b based on the Mistral 7b architecture. The model was adjusted to address topics such as depression, problems at work, mental health, problems with studies, drugs and others.
You can use the model in its normal form up to 4-bit quantization. Below we will use both approaches. Remember that verbs are important in your prompt. Tell your model how to act or behave so that you can guide them along the path of their response. Important points like these help models (even smaller models like 7b) to perform much better.
!pip install -q -U transformers
!pip install -q -U accelerate
!pip install -q -U bitsandbytes
from transformers import AutoModelForCausalLM, AutoTokenizer, TextStreamer
model = AutoModelForCausalLM.from_pretrained("rhaymison/Mistral-portuguese-luana-7b-mental-health", device_map= {"": 0})
tokenizer = AutoTokenizer.from_pretrained("rhaymison/Mistral-portuguese-luana-7b-mental-health")
model.eval()
You can use with Pipeline but in this example i will use such as Streaming
inputs = tokenizer([f"""<s>Aja como um conselheira de pessoas que estão passandos por dificuldades.
Responda sempre de maneira educada e procure ajudar as pessoas.
[INST] Olá, estou tendo muitos problemas pessoais, briga com meus pais. Tenho tido problemas no trabalho. Preciso de ajuda[/INST]"""], return_tensors="pt")
streamer = TextStreamer(tokenizer, skip_prompt=True, skip_special_tokens=True)
_ = model.generate(**inputs, streamer=streamer, max_new_tokens=200)
#Olá, estou aqui para ajudá-lo. É normal enfrentar problemas pessoais, mas é importante buscar ajuda.
#Vamos conversar sobre suas brigas com seus pais e como podemos resolver isso. Além disso, vamos falar sobre seus problemas no trabalho e como podemos encontrar
#soluções para isso. Você não está sozinho, estou aqui para ajudá-lo. Vamos começar a encontrar maneiras de lidar com essas questões.
#Você gostaria de começar falando sobre sua situação com seus pais?
#Ou talvez queremos começar falando sobre seus problemas no trabalho? O que você acha melhor? Você pode me contar mais sobre isso?
#Estou aqui para ajudá-lo.
from transformers import BitsAndBytesConfig
import torch
nb_4bit_config = BitsAndBytesConfig(
load_in_4bit=True,
bnb_4bit_quant_type="nf4",
bnb_4bit_compute_dtype=torch.bfloat16,
bnb_4bit_use_double_quant=True
)
model = AutoModelForCausalLM.from_pretrained(
base_model,
quantization_config=bnb_config,
device_map={"": 0}
)
Detailed results can be found here and on the 🚀 Open Portuguese LLM Leaderboard
| Metric | Value |
|---|---|
| Average | 65.05 |
| ENEM Challenge (No Images) | 60.53 |
| BLUEX (No Images) | 48.26 |
| OAB Exams | 38.04 |
| Assin2 RTE | 91.30 |
| Assin2 STS | 74.98 |
| FaQuAD NLI | 60.57 |
| HateBR Binary | 76.86 |
| PT Hate Speech Binary | 70.05 |
| tweetSentBR | 64.90 |
Any idea, help or report will always be welcome.
email: [email protected]
<div style="display:flex; flex-direction:row; justify-content:left"> <a href="https://www.linkedin.com/in/heleno-betini-2b3016175/" target="_blank"> <img src="https://img.shields.io/badge/LinkedIn-0077B5?style=for-the-badge&logo=linkedin&logoColor=white"> </a> <a href="https://github.com/rhaymisonbetini" target="_blank"> <img src="https://img.shields.io/badge/GitHub-100000?style=for-the-badge&logo=github&logoColor=white"> </a>