adarshxs/Therapy-Alpaca
Viewer • Updated • 10.5k • 9 • 4
How to use alibidaran/GRPO_LLAMA3_Reasoning_Consultor with Transformers:
# pip install -U transformers accelerate
# Load model directly
from transformers import AutoModel
model = AutoModel.from_pretrained("alibidaran/GRPO_LLAMA3_Reasoning_Consultor", device_map="auto")This model is Fined-tune with GRPO algorithm to make reasoning responses for mental health and consulting applications. The following link illustrates how to design reward models to train our model with GRPO algorithm.
https://www.kaggle.com/code/alibidaran/reasoning-consueling
messages = [
{'content':system_prompt,
'role': 'system'},
{"role": "user", "content": "I want to cut down drinking alchohol but when I am with my firends I need to drink. what should I do?"},
]
inputs = tokenizer.apply_chat_template(
messages,
tokenize = True,
add_generation_prompt = True, # Must add for generation
return_tensors = "pt",
).to("cuda")
from transformers import TextStreamer
text_streamer = TextStreamer(tokenizer, skip_prompt = True)
_ = model.generate(input_ids = inputs, streamer = text_streamer, max_new_tokens = 1024,
use_cache = True, temperature = 0.7, min_p = 0.9)
Base model
alibidaran/LLAMA3-instructive_reasoning