File size: 2,849 Bytes
48b04cf
 
 
 
 
 
 
 
 
 
 
 
 
 
94de9d7
 
 
 
 
 
 
 
1d72d6a
94de9d7
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1d72d6a
 
94de9d7
 
1d72d6a
e396c9e
 
 
 
 
 
 
 
 
 
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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
---
base_model: unsloth/llama-3.2-1b-bnb-4bit
tags:
  - text-generation
  - qlora
  - llama
  - gguf
  - lyrics
  - taylor-swift
license: apache-2.0
language: en
pipeline_tag: text-generation
---

# Taylor Swift Lyrics Llama Model (3.2, GGUF Format)

- **Base Model**: unsloth/llama-3.2-1b-bnb-4bit  
- **Fine-tuned on**: Taylor Swift lyrics using QLoRA
- **Format**: GGUF (Not compatible with the `transformers` library; requires `llama-cpp-python`)
- **License**: Apache-2.0
- **Developed by**: Covvenheimer and Team

This model, fine-tuned on Taylor Swift lyrics, is tailored for generating text in the style of her songs. It was trained with a 2x speed improvement using [Unsloth](https://github.com/unslothai/unsloth) and Hugging Face’s TRL library, specifically optimized for GGUF format.

> **Important:** This model requires `llama-cpp-python` to run. It is incompatible with the `transformers` library due to its GGUF format.

## Installation and Setup

To load and run this model, install the `llama-cpp-python` library and download the model file from the Hugging Face Hub.

### Step-by-Step Code Example

1. **Install llama-cpp-python**

   ```python
   !pip install llama-cpp-python
   ```

2. **Load the Model with llama-cpp**

   ```python
   from huggingface_hub import hf_hub_download
   from llama_cpp import Llama

   # Define your model repository and file name
   repo_id = "Covvenheimer/taylor_swift_model"
   filename = "unsloth.Q4_K_M.gguf"

   # Download the GGUF model file from Hugging Face
   model_path = hf_hub_download(repo_id=repo_id, filename=filename)

   # Load the model using llama-cpp-python
   llm = Llama(model_path=model_path)
   ```

3. **Generate Text Using a Prompt**

   ```python
   # Define a prompt for generating lyrics
   prompt = """You are a songwriter composing a song in the style of Taylor Swift.
   Write lyrics that reflect her themes and musical style, focusing on Love, Heartbreak, Romance."""

   # Generate lyrics
   output = llm(prompt, max_tokens=512, temperature=0.8)
   print(output["choices"][0]["text"])
   ```

   > **Tip:** To customize the themes, change the last line of the prompt. For example, you can modify the focus to other themes like "Friendship, Growth, Resilience." Replace `"Love, Heartbreak, Romance"` with your chosen themes.

This setup will allow you to use the model efficiently and generate lyrics in the style of Taylor Swift. 

---

# Uploaded  model

- **Developed by:** Covvenheimer
- **License:** apache-2.0
- **Finetuned from model :** unsloth/llama-3.2-1b-bnb-4bit

This llama model was trained 2x faster with [Unsloth](https://github.com/unslothai/unsloth) and Huggingface's TRL library.

[<img src="https://raw.githubusercontent.com/unslothai/unsloth/main/images/unsloth%20made%20with%20love.png" width="200"/>](https://github.com/unslothai/unsloth)