File size: 1,829 Bytes
46f917b
 
 
 
 
 
 
 
 
 
 
 
 
afe97bc
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
46f917b
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
---
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)