Giter Club home page Giter Club logo

Comments (5)

jsvine avatar jsvine commented on May 22, 2024

What version of markovify are you using? You'll need v0.4.1 or later to be able to pass one-word beginnings.

from markovify.

Kyu avatar Kyu commented on May 22, 2024

Yep, that was the issue 🤦

from markovify.

Kyu avatar Kyu commented on May 22, 2024

It's now returning ('_BEGIN', 'word') , but I guess that's an issue with not having enough sample to use.

Do you have any tips on managing memory usage? cpu usage spikes up and down 90% when this is used, and memory usage doubles and stays high. This is with a 2mb txt file

from markovify.

jsvine avatar jsvine commented on May 22, 2024

Hmmm, haven't noticed memory problems like that lately, but it's possible I've overlooked an edge case. Have you tried profiling your program?

If you send over the script and corpus, I can also try taking a look.

from markovify.

Kyu avatar Kyu commented on May 22, 2024
async def bloc_speaks(prompt=""):
    try:
        with open(os.getcwd() + '/BlocSim/BlocSpeaks.txt',
                  'r', encoding='utf-8') as f:
            text = f.read()
    except FileNotFoundError:
        print("File not found")
        return
    text_model = markovify.Text(text)
    try:
        if prompt:
            sentence = text_model.make_sentence_with_start(prompt)
            return sentence
        else:
            sentence = text_model.make_sentence()
            return sentence
    except Exception as e:
        return (e)

corpus

from markovify.

Related Issues (20)

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.