Instructions to use cyril21/breakfree-dialo-lora with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- PEFT
How to use cyril21/breakfree-dialo-lora with PEFT:
from peft import PeftModel from transformers import AutoModelForCausalLM base_model = AutoModelForCausalLM.from_pretrained("microsoft/DialoGPT-medium") model = PeftModel.from_pretrained(base_model, "cyril21/breakfree-dialo-lora") - Transformers
How to use cyril21/breakfree-dialo-lora with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="cyril21/breakfree-dialo-lora")# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("cyril21/breakfree-dialo-lora", dtype="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use cyril21/breakfree-dialo-lora with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "cyril21/breakfree-dialo-lora" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "cyril21/breakfree-dialo-lora", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/cyril21/breakfree-dialo-lora
- SGLang
How to use cyril21/breakfree-dialo-lora with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "cyril21/breakfree-dialo-lora" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "cyril21/breakfree-dialo-lora", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "cyril21/breakfree-dialo-lora" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "cyril21/breakfree-dialo-lora", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use cyril21/breakfree-dialo-lora with Docker Model Runner:
docker model run hf.co/cyril21/breakfree-dialo-lora
# Load model directly
from transformers import AutoModel
model = AutoModel.from_pretrained("cyril21/breakfree-dialo-lora", dtype="auto")Quick Links
BreakFree DialoGPT LoRA Adapter
This repository contains LoRA adapter weights fine-tuned on rehabilitation and mental health support dialogues. It is intended to be used with the base model microsoft/DialoGPT-medium.
Usage
import torch
from transformers import AutoModelForCausalLM, AutoTokenizer
from peft import PeftModel
base_id = "microsoft/DialoGPT-medium"
adapter_id = "cyril21/breakfree-dialo-lora"
tokenizer = AutoTokenizer.from_pretrained(base_id)
if tokenizer.pad_token is None:
tokenizer.pad_token = tokenizer.eos_token
base_model = AutoModelForCausalLM.from_pretrained(base_id)
model = PeftModel.from_pretrained(base_model, adapter_id)
model.eval()
prompt = "User: Hello\nAssistant:"
inputs = tokenizer(prompt, return_tensors="pt")
with torch.no_grad():
output = model.generate(
**inputs,
max_new_tokens=80,
do_sample=True,
top_p=0.9,
temperature=0.8,
pad_token_id=tokenizer.eos_token_id,
)
print(tokenizer.decode(output[0], skip_special_tokens=True))
Training Data
Fine-tuned on a local rehabilitation dialogue dataset. A public dataset repo is provided separately.
Limitations
This model is intended for supportive, non-clinical conversation. It is not a substitute for professional medical or mental health advice.
Model Card Contact
[More Information Needed]
Framework versions
- PEFT 0.17.1
- Downloads last month
- 47
Model tree for cyril21/breakfree-dialo-lora
Base model
microsoft/DialoGPT-medium
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="cyril21/breakfree-dialo-lora")