File size: 2,144 Bytes
e4eaf5d
c82afb6
a857599
 
 
 
 
 
 
 
 
 
e4eaf5d
a857599
e4eaf5d
 
a857599
e4eaf5d
a857599
e4eaf5d
 
 
a857599
 
e4eaf5d
a857599
e4eaf5d
a857599
e4eaf5d
a857599
e4eaf5d
a857599
e4eaf5d
a857599
 
 
 
e4eaf5d
a857599
 
e4eaf5d
a857599
 
 
e4eaf5d
a857599
 
 
 
e4eaf5d
a857599
 
 
 
e4eaf5d
a857599
e4eaf5d
a857599
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
---
base_model: Haleshot/Mathmate-7B-DELLA-ORPO
tags:
- finetuned
- orpo
- everyday-conversations
- adapter
datasets:
- HuggingFaceTB/everyday-conversations-llama3.1-2k
license: apache-2.0
language:
- en
library_name: transformers
pipeline_tag: text-generation
---

# Mathmate-7B-DELLA-ORPO-C

Mathmate-7B-DELLA-ORPO-C is a LoRA adapter for [Haleshot/Mathmate-7B-DELLA-ORPO](https://huggingface.co/Haleshot/Mathmate-7B-DELLA-ORPO), finetuned to improve performance on everyday conversations.

## Model Details

- **Base Model:** [Haleshot/Mathmate-7B-DELLA](https://huggingface.co/Haleshot/Mathmate-7B-DELLA-ORPO)
- **Training Dataset:** [HuggingFaceTB/everyday-conversations-llama3.1-2k](https://huggingface.co/datasets/HuggingFaceTB/everyday-conversations-llama3.1-2k)

## Dataset

The model was finetuned on the [HuggingFaceTB/everyday-conversations-llama3.1-2k](https://huggingface.co/datasets/HuggingFaceTB/everyday-conversations-llama3.1-2k) dataset, which focuses on everyday conversations and small talk.

## Usage

To use this LoRA adapter, you need to load both the base model and the adapter. Here's an example:

```python
from transformers import AutoTokenizer, AutoModelForCausalLM
from peft import PeftModel, PeftConfig
import torch

base_model_name = "Haleshot/Mathmate-7B-DELLA"
adapter_name = "Haleshot/Mathmate-7B-DELLA-ORPO-C"

base_model = AutoModelForCausalLM.from_pretrained(base_model_name, torch_dtype=torch.float16, device_map="auto")
tokenizer = AutoTokenizer.from_pretrained(base_model_name)
model = PeftModel.from_pretrained(base_model, adapter_name)

def generate_response(prompt, max_length=512):
    inputs = tokenizer(prompt, return_tensors="pt").to(model.device)
    outputs = model.generate(**inputs, max_length=max_length, num_return_sequences=1, do_sample=True, temperature=0.7)
    return tokenizer.decode(outputs[0], skip_special_tokens=True)

prompt = "Let's have a casual conversation about the weather today."
response = generate_response(prompt)
print(response)
```

## Acknowledgements

Thanks to the HuggingFaceTB team for providing the everyday conversations dataset used in this finetuning process.