File size: 6,662 Bytes
301292e |
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 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 |
---
license: other
license_name: helpingai
license_link: LICENSE.md
pipeline_tag: text-generation
tags:
- HelpingAI
- Emotionally Intelligent
---
# HelpingAI-9B: The King of Human like Emotion
![logo](https://huggingface.co/OEvortex/HelpingAI-3B/resolve/main/HelpingAI.png)
## Overview
HelpingAI-9B is a large language model designed for emotionally intelligent conversational interactions. It is trained to engage users with empathy, understanding, and supportive dialogue across a wide range of topics and contexts. The model aims to provide a supportive AI companion that can attune to users' emotional states and communicative needs.
## Objectives
- Engage in open-ended dialogue while displaying emotional intelligence
- Recognize and validate user emotions and emotional contexts
- Provide supportive, empathetic, and psychologically-grounded responses
- Avoid insensitive, harmful, or unethical speech
- Continuously improve emotional awareness and dialogue skills
## Methodology
HelpingAI-9B is based on the HelpingAI series and further trained using:
- Supervised learning on large dialogue datasets with emotional labeling
- Reinforcement learning with a reward model favoring emotionally supportive responses
- Constitution training to instill stable and beneficial objectives
- Knowledge augmentation from psychological resources on emotional intelligence
## Usage code
```python
from transformers import AutoModelForCausalLM, AutoTokenizer
import torch
device = "cuda" # the device to load the model onto
model = AutoModelForCausalLM.from_pretrained(
"OEvortex/HelpingAI-9B",
torch_dtype='auto',
device_map="auto"
)
tokenizer = AutoTokenizer.from_pretrained("OEvortex/HelpingAI-9B")
prompt = "Express joy and excitement about visiting a new place"
messages = [
# {"role": "system", "content": "You are a helpful AI assistant."},
{"role": "user", "content": prompt}
]
text = tokenizer.apply_chat_template(
messages,
tokenize=False,
add_generation_prompt=True
)
model_inputs = tokenizer([text], return_tensors="pt").to(device)
generated_ids = model.generate(
model_inputs.input_ids,
max_new_tokens=1024,
eos_token_id=tokenizer.eos_token_id,
temperature=0.25,
)
generated_ids = [
output_ids[len(input_ids):] for input_ids, output_ids in zip(model_inputs.input_ids, generated_ids)
]
response = tokenizer.batch_decode(generated_ids)[0]
print(response)
```
*Directly using this model from GGUF*
```python
%pip install -U 'webscout[loacl]'
from webscout.Local.utils import download_model
from webscout.Local.model import Model
from webscout.Local.thread import Thread
from webscout.Local import formats
from webscout.Local.samplers import SamplerSettings
from dotenv import load_dotenv; load_dotenv()
import os
# 1. Download the model
repo_id = "OEvortex/HelpingAI-9B"
filename = "helpingai-9b.Q4_0.gguf"
model_path = download_model(repo_id, filename, os.environ.get("hf_token"))
# 2. Load the model
model = Model(model_path, n_gpu_layers=0)Β
# 3. Define your system prompt
system_prompt = "You are HelpingAI a emotional AI always answer my question in HelpingAI style"
# 4. Create a custom chatml format with your system prompt
custom_chatml = formats.chatml.copy()
custom_chatml['system_content'] = system_prompt
# 5. Define your sampler settings (optional)
sampler = SamplerSettings(temp=0.7, top_p=0.9)Β # Adjust these values as needed
# 6. Create a Thread with the custom format and sampler
thread = Thread(model, custom_chatml, sampler=sampler)
# 7. Start interacting with the model
thread.interact(header="π HelpingAI-9B: The King of Human-like Emotion π", color=True)
```
## Example Dialogue
> Express joy and excitement about visiting a new place.
Yay! I'm super excited to visit this new place! π It sounds amazing and I can't wait to explore and have fun there! This is going to be such an exciting adventure! π Let's go, let's do this! β¨
> I'm feeling really down today. Nothing seems to be going right.
Oh no, I'm sorry to hear that you're feeling down. It happens sometimes, but remember that it's okay to feel sad. If you want to talk about what's bothering you, I'm here to listen and offer support. We can find a way through this together! π
> I'm excited because I just got accepted into my dream school! I wanted to share the good news with someone.
Wow, that's amazing! π Congratulations on getting accepted into your dream school! That's such an incredible accomplishment and I'm really happy for you! Keep up the hard work and enjoy the journey ahead! π If there's anything else I can do to help, just let me know! π
> My best friend just got into an argument with me and I don't know what to do. How can I fix this situation?
Oh no, it sounds like you both need some time to cool off. Take a step back and give each other some space. Then, when things have calmed down, try talking things through in a calm and respectful manner. Communication is key for resolving conflicts, so let's work towards finding a resolution that works for both of you! π If you need any advice or support, I'm here to help! π
> How can you identify the emotions of others based on their body language and facial expressions?
Identifying the emotions of others is a great skill! π€ You can look for body language cues like frowns, smiles, or tense posture. Facial expressions also give away a lot about someone's feelings - watch out for changes in their eyes, mouth, and facial muscles. It's all about being observant and empathetic to understand others better! π
> What kind of safety devices do I need to install in my house
Installing security devices in your home can bring peace of mind and keep you safe. Some essential safety devices include a home alarm system, smoke detectors, carbon monoxide detectors, motion sensors, and surveillance cameras. It's always good to take precautions and ensure that your home is secure! π If you need help choosing the right security devices for your family, I can definitely point you in the right direction! π
> How can your own feelings affect your ability to empathize with someone else?
Our own emotions can impact our ability to empathize with others because they shape how we perceive and interpret other people's experiences. If you're feeling happy or positive, it may be easier to see the good in others and offer support. On the other hand, if you're feeling down or stressed, it might be harder to put yourself in someone else's shoes. It's important to acknowledge your own feelings and work on being open and understanding towards others! π |