GithubHelp home page GithubHelp logo

julionectar / easy_text_generator Goto Github PK

View Code? Open in Web Editor NEW

This project forked from alexcg1/easy_text_generator

0.0 0.0 0.0 2.74 MB

Generate text from machine-learning models right in your browser

Python 100.00%

easy_text_generator's Introduction

Easy Text Generator

AI-powered text generation for mere mortals.

made-with-python

What is it?

An app that runs in your web browser and uses a nice GUI interface to generate text from pre-trained machine learning models like GPT-2. It doesn't support training models at the moment.

Advanced options

  • top_k and top_p are explained well here
  • For model from transformers, just copy the foo/bar phrase from any model in https://huggingface.co/models. Not everything will work, but anything using GPT or text generation in general (i.e. not sentiment analysis, etc) should work okay.

How Do I Use it?

Precautions

  • Machine learning needs a LOT of RAM. I highly recommend 16gb or more, or enabling a swap partition if you're on Linux. Otherwise your machine may just lock up during install or running the program (it happened to me plenty).
  • The process may take a while. The video above is highly edited. It really took about 3 minutes to generate that text on my laptop.

Install

git clone [email protected]:alexcg1/easy_text_generator
cd easy_text_generator
pip install -r requirements.txt

Run

In the same directory as above

streamlit app.py

It opens a tab in your web browser where you can choose the model you want and generate text.

Thanks to:

Can I See some Examples?

General text (distilgpt2)

Starting text: There once was an ugly duckling

There once was an ugly duckling in the woods. It didn't hurt. The little little
yellow duckling was just so well dressed, and looked like so many of us. She
didn't really know how it looked, or why it looked. Her face was completely
lost, but now there is a lot more. I don't know what my mind was about this
thing. But she just felt sad. And when I saw her that day the eyes were staring
at her again. It was horrible. I saw it's ugly little duckling, or whatever it
is, but it always looked ugly. And I just knew that once again, this was not
something she liked to see. The little green duckling was just so well dressed.
But it looked like that too. There was nothing I could do. I was just really

General text (GPT-2)

Starting text: It is a truth universally acknowledged

It is a truth universally acknowledged that any single person's life will change
when he or she becomes a parent, even if he or she becomes a parent on his or
her own. To put it bluntly, that person's life will change for the better if he
or she gets a baby and the child is adopted.  When I talk to children in
orphanages or on the streets that all I hear is talk of wanting to adopt and
growing up being a "good baby" or that children are not in trouble when they
don't get adopted because "the community would always give them a chance." I
don't want to hear that when they ask, "What did you know or don't know about
adoption?" 

Star Trek scripts

Starting text: One to beam up Mr Scott

[Transporter room]

SCOTT: Mister Data. 
DATA: We are still at three million kilometres. 
SCOTT: Mister Data, you won't have much time. Beam away. 
DATA: We will be gone in two minutes. 
SCOTT: Mister Data, you just won't do it. You have to get back into
here, Mister Data. 
DATA: Sir, I wish to

easy_text_generator's People

Contributors

alexcg1 avatar dependabot[bot] 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.