Giter VIP home page Giter VIP logo

tolkien-text-generator's Introduction

tolkien-text-generator

Fine tuning HuggingFace CausalLMs to generate text resembling J. R. R. Tolkien's writing.

About

This repo contains the code to fine tune a causalLM of your choice as well as easily generating your own text.

Personally, I tested this using the the models EleutherAI/gpt-neo-125M and facebook/opt-350M. In theory, any other hugging face CausalLM can be used, but given my memeory constrains (32GB RAM w/ GTX 3090) I was limited to relatively smaller models. For the most part, larger and more recently released models should produce better results.

While I only fine-tuned on Tolkien's writings, any text can be used. For the best results, I suggest splitting text into roughly paragraph length.

Usage

To fine-tune a model:

bin/train.sh --model_name model_name

model_name defaults to facebook/opt-350M. Run bin/train.sh -h for a list of other parameters.

To generate text:

bin/gen.sh --model_name model_name --model_dir model_dir

Where model_name is the hugging face pre trained model, and model_dir is the fine tuned model.

model_name defaults to facebook/opt-350M

tolkien-text-generator's People

Contributors

rcgreen99 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.