Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/audiodude/endless-love-letters

Scripts for generating love letters for my wife via AI
https://github.com/audiodude/endless-love-letters

Last synced: about 2 months ago
JSON representation

Scripts for generating love letters for my wife via AI

Awesome Lists containing this project

README

        

# Endless Love Letters

This is the source code for the site at https://endless-love-letters.com

Since 2019, I have written my wife Abby a love letter every day, for a total of 1458 captured
at the time of the Google Takeout export.

These scripts take an `.mbox` file with a bunch of love letter emails, parse them out, feed them to
the OpenAI GPT 3.5 finetuning API to finetune a model, then generate new love letters.

The web interface includes both v1 (static love letter list generated with some pre-GPT charNN-like
solution whose name has been lost) and v2 (love letters generated on the fly with ChatGPT).

## Populating the SECRETS file

Look at `SECRETS.example` for the tokens which should go into `SECRETS`, which is a JSON file.
Neither the site nor the command line tools will function without the `SECRETS` being set.

## Generating a love letter offline

Offline meaning without the web app, this still contacts the OpenAI API.

Just run:

```bash
python generate.py
```

Note that the prompts and model id are hardcoded into the script.

## Generating the database

In MySQL, run:

```sql
CREATE DATABASE endless_love_leeters;
```

Then load the schema:

```bash
mysql -u -p endless_love_letters < schema.sql
```

## Running the web app locally

```bash
FLASK_DEBUG=1 FLASK_APP=app pipenv run flask run
```

## Deploying to fly,io

1. Install the Fly.io command line tool, `flyctl`

```bash
fly deploy
```