Git Product home page Git Product logo

Comments (2)

chipotle avatar chipotle commented on August 19, 2024

This is (probably) a rate limit error. The notebook as provided has absolutely no error reporting/handling, which makes it difficult to be sure, but it's the most likely culprit. I would suggest, if you want to play around this and don't want to give Anthropic lots of money to increase your rate limit,

  • request a smaller number of chapters
  • in the line chapter = generate_text(chapter_prompt, max_tokens=4000), lower the tokens to 3000

If you want to delve into Python a bit more, I would also suggest adding some basic error handling to generate_text, and maybe retry on a 429 or 529 error (which are hitting your rate limit and Anthropic's API being overloaded, respectively). I used something like

if response.status_code != 200:
    print(f" ! got status code {response.status_code}")
    print(response.json())
else:
    response_text = response.json()['content'][0]['text']
    return response_text.strip()

…but I also broke the notebook down into a series of cells rather than just one big script, because I wanted to be able to investigate just what's being generated along the way to see things like "how good is the outline Claude-Author has generated from the prompt" and "how well is Claude-Author following its own generated outline as it creates the chapters".

from gpt-author.

aithec77 avatar aithec77 commented on August 19, 2024

Thank you very much for your reply. I reduced the number of chapters to 10 and now the books are generated without errors)

from gpt-author.

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.