| | --- |
| | base_model: unsloth/qwen3-0.6b-bnb-4bit |
| | tags: |
| | - text-generation-inference |
| | - transformers |
| | - unsloth |
| | - qwen3 |
| | - trl |
| | license: apache-2.0 |
| | language: |
| | - en |
| | --- |
| | |
| | # Usage |
| |
|
| | 4-bit-quantized Qwen 0.6B fine-tuned on the english version of `brighter-dataset/BRIGHTER-emotion-categories'. |
| |
|
| | To use the model: |
| |
|
| | ``` |
| | from transformers import AutoModelForCausalLM, AutoTokenizer |
| | import torch |
| | |
| | |
| | tokenizer = AutoTokenizer.from_pretrained( |
| | "FritzStack/QWEmotioN-4bit", |
| | trust_remote_code=True |
| | ) |
| | |
| | model = AutoModelForCausalLM.from_pretrained( |
| | "FritzStack/QWEmotioN-4bit", |
| | torch_dtype=torch.float16, |
| | device_map="auto", |
| | trust_remote_code=True |
| | ) |
| | |
| | def predict_emotions(text, max_new_tokens=50): |
| | """ |
| | Predict emotions for a given text |
| | """ |
| | prompt = f"{text}. " |
| | inputs = tokenizer(prompt, return_tensors="pt").to(model.device) |
| | |
| | with torch.no_grad(): |
| | outputs = model.generate( |
| | **inputs, |
| | max_new_tokens=max_new_tokens, |
| | do_sample=False, |
| | #temperature=0.8, |
| | top_k = 10, |
| | #repetition_penalty=35., |
| | pad_token_id=tokenizer.eos_token_id |
| | ) |
| | |
| | generated_text = tokenizer.decode( |
| | outputs[0][len(inputs.input_ids[0]):], |
| | skip_special_tokens=False |
| | ).strip() |
| | |
| | return generated_text |
| | ``` |
| |
|
| |
|
| | ``` |
| | print(predict_emotions("I miss you")) |
| | ### Output |
| | Emotion Output: sadness <|im_end|> |
| | ``` |
| |
|
| |
|
| | # Uploaded model |
| |
|
| | - **Developed by:** FritzStack |
| | - **License:** apache-2.0 |
| | - **Finetuned from model :** unsloth/qwen3-0.6b-bnb-4bit |
| |
|
| | This qwen3 model was trained 2x faster with [Unsloth](https://github.com/unslothai/unsloth) and Huggingface's TRL library. |
| |
|
| | [<img src="https://raw.githubusercontent.com/unslothai/unsloth/main/images/unsloth%20made%20with%20love.png" width="200"/>](https://github.com/unslothai/unsloth) |
| |
|