Skip to content

Making a rest API with Axum, Docker, Digital Ocean Droplet, and GitHub Actions to utilize a fine-tuned GPT2 model.

License

Notifications You must be signed in to change notification settings

Rybeardawg1/Jojos-Bizarre-API

Repository files navigation

Jojos-Bizarre-API

Gonna make an NLP model that'll respond to API calls. Maybe make it into a Twitter bot too or something.. idk

To Do:

Get all Jojo script data

  • get scripts
  • get better formatted scripts for NLP
Show: https://transcripts.foreverdreaming.org/viewforum.phpf=1721
Important quotes: https://en.wikiquote.org/wiki/JoJo%27s_Bizarre_Adventure
Manga: picture-to-text scanner maybe?
Manga: https://mangadex.org/title/136/jojo-s-bizarre-adventure-part-1-phantom-blood

The API itself

  • Make REST API that will call model when prompted and return quote when unprompted
  • Flask is lame, learn Rust and use Axum?
  • Fix output not rendering newlines
  • Figure out how to use Jojo-GPT2 in Rust

Learn about NLPs

  • Understand NLP basics

  • Train jojo-gpt2

  • Train a better one

  • Test different models Llama 2, GPT-NeoX, GPT-J, Vicuna-13B, XGen-7B

  • Understand tokenization, stemming, and lemmatization

  • Apply/practice concepts

Hosting

Domain: https://instantdomains.com/search?q=jojosbizarreapi ITS MINE
https://www.heroku.com/
https://www.pythonanywhere.com/
https://www.digitalocean.com/
https://www.shuttle.rs/
AWS Lambda?

Digital Ocean Web App 👎BOO tomato tomato tomato
Digital Ocean Droplet

  • Build and containerize the API
  • Create CI/CD pipeline with GitHub Actions
  • Deploy API and use domain
  • HTTPS
  • Manually upload model through SSH or store on Google Drive lol

Running Development Server

Flask:
python flask_api.py

Axum:
If you want to use pytorch instead of libtorch, you may need to follow these instructions:
pip install torch torchvision torchaudio
python -m venv C:\Users\Rybeardawg1\AppData\Local\Programs\Python\Python39\Lib\venv
set LIBTORCH_USE_PYTORCH=1
As of now, tch version 0.14.0 crate supports up to PyTorch 2.1.0. If you need to downgrade, use pip install torch==2.1.0

If you want to use libtorch, download here:https://pytorch.org/ and you may need to set these env variables:
set LIBTORCH_USE_PYTORCH=0
set LIBTORCH_BYPASS_VERSION_CHECK=0
cargo build
cargo run

About

Making a rest API with Axum, Docker, Digital Ocean Droplet, and GitHub Actions to utilize a fine-tuned GPT2 model.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published