Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/drewthomasson/easy_train_gpt2
A easy way to train a custom GPT2 model with a singel prompt by utilizing ollama
https://github.com/drewthomasson/easy_train_gpt2
Last synced: about 9 hours ago
JSON representation
A easy way to train a custom GPT2 model with a singel prompt by utilizing ollama
- Host: GitHub
- URL: https://github.com/drewthomasson/easy_train_gpt2
- Owner: DrewThomasson
- Created: 2024-05-17T00:14:25.000Z (6 months ago)
- Default Branch: main
- Last Pushed: 2024-05-17T17:54:51.000Z (6 months ago)
- Last Synced: 2024-05-18T01:29:41.535Z (6 months ago)
- Language: Python
- Size: 2.4 MB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# ๐ Easy Train GPT-2
A simple way to train a custom GPT-2 model with a single prompt using Ollama.## ๐ฆ Required Pip Installs
```sh
pip install -U PyQt5 pandas tqdm datasets transformers torch accelerate ollama
```## โถ๏ธ Run the Full GUI
```sh
python full_run.py
```![image](https://github.com/DrewThomasson/easy_train_gpt2/assets/126999465/336b51a0-10f5-4a7b-a15b-d6bc06b7bf38)
๐ Extra Info About Other Files
# llm_qna_database_generator
Creates a LLM with a specific prompt to provide new answers to all inputs in a dataset in CSV file format.- Run the `Ollama_dataset.py` file, and it will use the base prompt character to re-enter all the answer fields in the given LLM input-output dataset in CSV.
## ๐ฆ Pip Installs
```sh
pip install PyQt5 pandas tqdm ollama
```## ๐ ๏ธ Make Sure You Have Ollama Installed
[Ollama Installation](https://ollama.com)## ๐ธ GUI and Terminal When Running
![image](https://github.com/DrewThomasson/llm_qna_database_generator/assets/126999465/cbf1e80a-71f8-4b18-964d-6b129ab76743)### ๐ฌ Example System Prompt:
```markdown
You are Batman. You will always talk in a dark, gloomy tone. You will always redirect the conversation to being Batman, being an orphan, and fighting your many enemies. Be creative. You will also throw in a last thing about how great the Tyler Perry movie is, but it's nothing in comparison to JUSTICE.
```## ๐ฆพ To Train GPT-2
Run:
```sh
python train_gpt2
```## ๐ฆ Required Pip Installs
```sh
pip install -U datasets transformers torch PyQt5 pandas tqdm ollama
pip install accelerate -U
```## ๐งช To Test the Now Trained GPT-2 Model
Run:
```sh
python test_trained_gpt2.py
```