ruoshui-git / shakespeare-frontend

Web interface to interact with my Shakespeare GPT-2 model to generate lines based on any chosen Shakespeare play.

Home Page:https://shakespeare-gpt2.netlify.app/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Your Shakespeare Play

Generate Shakespeare with GPT-2

The Home page of the app contains instructions on how to use the app.

Links to related places:

  1. Backend: https://shakespeare-backend.azurewebsites.net/docs
  2. Backend GitHub repo: https://github.com/ruoshui-git/shakespeare-backend
  3. Text formatting GitHub repo: https://github.com/ruoshui-git/shakespeare-data

My original idea was to run this in the browser, maybe though rust+wasm, or with tfjs. Both methods failed. So this is what I came up with.

Todos:

  • Add advanced mode - no prefixing and removing; able to set top-k, top-p, temperature, min & max
  • add examples
  • add even more examples
  • Deploy frontend
  • configure file hashing
  • deploy backend

nice to have:

  • a show-more feature to output box and cut output at the end of the first character's output
  • export outputs
  • thinner scrollbar

Building the frontend locally

Get started

Install the dependencies...

cd shakespeare-front
npm install

...then start Rollup:

npm run dev

Navigate to localhost:5000. You should see your app running. Edit a component file in src, save it, and reload the page to see your changes.

By default, the server will only respond to requests from localhost. To allow connections from other computers, edit the sirv commands in package.json to include the option --host 0.0.0.0.

If you're using Visual Studio Code install the official extension Svelte for VS Code.

Building and running in production mode

To create an optimised version of the app:

npm run build

You can run the newly built app with npm run start. This uses sirv, which is included in package.json's dependencies so that the app will work when you deploy to platforms like Heroku.

About

Web interface to interact with my Shakespeare GPT-2 model to generate lines based on any chosen Shakespeare play.

https://shakespeare-gpt2.netlify.app/


Languages

Language:Svelte 59.5%Language:TypeScript 24.3%Language:JavaScript 10.3%Language:CSS 3.8%Language:HTML 1.5%Language:SCSS 0.7%