adarshxs/Therapy-Alpaca
Viewer • Updated • 10.5k • 93 • 4
How to use alibidaran/GRPO_LLAMA3_Reasoning_Consultor with Transformers:
# Load model directly
from transformers import AutoModel
model = AutoModel.from_pretrained("alibidaran/GRPO_LLAMA3_Reasoning_Consultor", dtype="auto")How to use alibidaran/GRPO_LLAMA3_Reasoning_Consultor with Unsloth Studio:
curl -fsSL https://unsloth.ai/install.sh | sh # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for alibidaran/GRPO_LLAMA3_Reasoning_Consultor to start chatting
irm https://unsloth.ai/install.ps1 | iex # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for alibidaran/GRPO_LLAMA3_Reasoning_Consultor to start chatting
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for alibidaran/GRPO_LLAMA3_Reasoning_Consultor to start chatting
pip install unsloth
from unsloth import FastModel
model, tokenizer = FastModel.from_pretrained(
model_name="alibidaran/GRPO_LLAMA3_Reasoning_Consultor",
max_seq_length=2048,
)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