Downloads · 30 days
5
10% of all-time downloads
Tanaybh/dialogpt-medium-qlora-alpaca
dialogpt-medium-qlora-alpaca is a machine learning model from Tanaybh. Use it for the machine learning task on the model card, and read the license before you ship it in a product. It is set up for peft. The card lists the license as mit.
This model is a LoRA (Low-Rank Adaptation) fine-tuned version of microsoft/DialoGPT-medium trained on a subset of the Alpaca instruction-following dataset.
Downloads · 30 days
5
10% of all-time downloads
All-time downloads
48
Public
Repo size
50.4 MB
Likes
0
Public
Click a slice to open those files.
.safetensors50.4 MB · 91%
From the Hugging Face model README
This model is a LoRA (Low-Rank Adaptation) fine-tuned version of microsoft/DialoGPT-medium trained on a subset of the Alpaca instruction-following dataset.
This model demonstrates improved instruction-following capabilities compared to the base DialoGPT-medium model, with responses that:
from transformers import AutoTokenizer, AutoModelForCausalLM
from peft import PeftModel
# Load base model and tokenizer
base_model_name = "microsoft/DialoGPT-medium"
tokenizer = AutoTokenizer.from_pretrained(base_model_name)
base_model = AutoModelForCausalLM.from_pretrained(base_model_name)
# Load LoRA adapter
model = PeftModel.from_pretrained(base_model, "Tanaybh/dialogpt-medium-qlora-alpaca")
# Add padding token
if tokenizer.pad_token is None:
tokenizer.pad_token = tokenizer.eos_token
def generate_response(prompt):
input_text = f"Instruction: {prompt}\nResponse:"
inputs = tokenizer.encode(input_text, return_tensors="pt")
with torch.no_grad():
outputs = model.generate(
inputs,
max_new_tokens=80,
temperature=0.7,
do_sample=True,
pad_token_id=tokenizer.eos_token_id,
top_p=0.8,
repetition_penalty=1.2
)
response = tokenizer.decode(outputs[0], skip_special_tokens=True)
return response.split("Response:")[-1].strip()
# Example usage
response = generate_response("What is machine learning?")
print(response)
Q: What is artificial intelligence? A: It's a computer program designed to detect patterns in images and predict them based on what they are. It can be used for machine learning, image recognition, or machine translation, among other things.
Q: What is the difference between AI and ML? A: AI is a programming language for AI systems. ML is an algorithm for ML systems, like Deep Learning, Deep Recognition, etc. It uses the same algorithms as other algorithms, but is used in more advanced applications.
This model was fine-tuned using a Mac-optimized approach that provides QLoRA-like benefits without requiring CUDA-specific quantization libraries:
If you use this model, please cite:
@misc{dialogpt-medium-qlora-alpaca,
author = {Tanay Bhardwaj},
title = {DialoGPT-Medium LoRA Fine-tuned on Alpaca Dataset},
year = {2025},
url = {https://huggingface.co/Tanaybh/dialogpt-medium-qlora-alpaca}
}
MIT License - see base model license for additional terms.