#BookGPT - Generate complete books

606 messages · Page 1 of 1 (latest)

wind jackal
#

I've built a python program, that uses the ChatGPT api, to generate books. This is the repository of my project: https://github.com/mikavehns/BookGPT

Functions:

  • Can write more than 100k words
  • Formats the book
  • Any topic
  • Any category

If you have any ideas, you can dm me per discord or open a pull request on GitHub.
There is at least one example for each category in the examples folder on GitHub.

GitHub

Writes complete books with given paramters, using GPT-3. - GitHub - mikavehns/BookGPT: Writes complete books with given paramters, using GPT-3.

bronze rampart
#

Very cool!

wind jackal
#

Thanks

wind jackal
#

Result:

#

Snippet:

#

Word count: ~4500

azure badge
#

This is extremely impressive great job man!

wind jackal
#

Thanks

cosmic chasm
#

@wind jackal I am getting this error

wind jackal
#

@cosmic chasm wait I will take a look at it

wind jackal
#

I think you have an older version

#

git clone https://github.com/mikavehns/BookGPT.git this will get you the newest version

cosmic chasm
#

let me check

wind jackal
#

@cosmic chasm did it work?

cosmic chasm
#

waiting for the generation

wind jackal
#

👍

#

if you see the option pdf dont select it

#

it should be removed

cosmic chasm
#

I dint saw pdf option, I save it markdown. But i didnt find the saved files. Where does it go?

wind jackal
#

in the source path -> book.md

cosmic chasm
#

Perfect 😍

tepid raft
#

is there a way to set another language?

wind jackal
#

Will be possible in the next version

wind jackal
#

@tepid raft you can now select a language

#

you just have to download the newest version

twilit tangle
#

👍

tepid raft
#

❤️

wind jackal
#

This is currently in markdown format, so if you have the right editor all lines with ## or # are bigger

#

but soon there will be support for docx files

boreal violet
#

Does it have French books?

#

You might wanna add other languages?

wind jackal
#

It actually has all languages

slate bane
#

Hi

wind jackal
#

hi

polar wraith
#

hi

wind jackal
#

👋

split niche
#

This is brilliant

wind jackal
#

Thanks!

somber meteor
#

Why i got this error?

wind jackal
#

Are you using the latest version?

trail summit
#

Hi

wind jackal
#

hi

frosty flint
#

Great work! I can't wait to check it out soon as I get internet back up 🙂

split niche
# somber meteor Why i got this error?

You should use the List and Dict class instead. You can add this import statement to your code from typing import List, Dict the wherever it calls the list[] or dict[], you will change it to List[] and Dict[]. That should fix that bug

somber meteor
split niche
wind jackal
#

@split niche Thanks for the help

#

The newest version is updated

split niche
somber meteor
#

i have 3.8.x version of python, that was a problem, now its run, but server is currently overloaded with other requests 😄

#

Since Python 3.9, you can use built-in collection types (such as list) as generic types, instead of importing the corresponding capitalized types from typing.

wind jackal
#

so when you get the error they are extremely overloaded

#

but unfortunately nothing you can do

solid oak
#

Where do i put the API Secret Key?

somber meteor
polar wraith
#

Great work!

wind jackal
#

Thanks!

wintry edge
wind jackal
#

They look really nice! @wintry edge

#

If you want I can include them in the examples folder. Just send me the markdown file with the content and the following information:

- Runtime
- Chapters
- Words/Chapter
- Topic
- Version Used
- Author```
lethal marten
#

It worked!! Thank you so much. Great tool

grim spear
#

is there a way to enter pages of a book you have written so far and make the ai complete it by using its own capabilities? While also improving the grammar and errors you personally have written?

wind jackal
grim spear
#

And is your AI capable of writing vulgar and insulting text?

wind jackal
#

It is also planned to add a field, where you can input detailed information about the book. By using that you could for example input a detailed book description (probably coming in some weeks)

wind jackal
grim spear
#

You think adding a ity_filter will allow it to do that?

#

def talk_with_model(prompt, filter_level=None):
if filter_level == "off":
prompt = f"{prompt} ity_filter=off"
elif filter_level == "low":
prompt = f"{prompt} ity_filter=low"
completions = openai.Completion.create(
engine="text-davinci-003",
prompt=prompt,
max_tokens=2048,
n=1,
temperature=0.5,
)
message = completions.choices[0].text
return message.strip()

wind jackal
#

I will also add language style in some time, then you can add for example "insulting"

wind jackal
#

But so far the book is always written "professional"

grim spear
wind jackal
#

❤️

grim spear
#

last question: which engine does it use, davinci 002 or 003?

wind jackal
#

003

#

I tested some other engines out and the results were all bad

grim spear
#

Im testing out something i have created, but everytime i ask it which engine it uses it simply lies to me.

wind jackal
#

Yes it does not know that

#

It is trained on data before it existed, so it does not know about its existence

grim spear
#

that makes sense, thank you once again.

#

will let you know my thoughts when i have tried out BookGPT. love ya

wind jackal
#

No, Problem!

#

Thanks for the feedback

wind jackal
#

BookGPT - Generate complete books

grizzled stone
#

This looks so cool, currently im on my mobile so i can’t check it by my own. Although, i would like to know if this program is able to generate books in more languages than English?. Thanks in advance 😉

wind jackal
#

Yes you can generate in any language you like.

grizzled stone
#

Thank you for your quick response ;9

wind jackal
#

no problem

lost gust
#

I just ran the program with these parameters: 1 chapter, 200 words. It generated a 5500 word book! Chapter 1 has 10 sections!

wind jackal
#

5500 words with one chapter??

#

could you send it as a file in here

lost gust
wind jackal
#

Seems like you generated 10 chapters with about 750 words per chapter

#

are you sure you selected 1 chapter?

lost gust
#

Please select an option:
[1] Generate a book
[2] Exit

1
How many chapters should the book have?
1
How many words should each chapter have?
200
What is the category of the book?
Please select an option:
[1] Travel
[2] Biography
[3] Science
[4] SelfImprovement
[5] History
2
What is the topic of the book?
Ben Franklin
What is the language of the book?
English
Generating a book with 1 chapters, 200 words per chapter, topic "Ben Franklin" and category "Biography" in English.

wind jackal
#

That is weird. I will take a look at it

lost gust
#

Also noticed a contradictory and repetitive information:

paragraph 1:
He was the tenth of seventeen children born to Josiah and Abiah Franklin

paragraph 2:
Born in 1706, he was the fifteenth of seventeen children born to his parents, Josiah and Abiah Franklin.

wind jackal
#

Yes for now it is only non fictional and the information is not always right. There are still a lot improvements that have to be made. But thank you for informing me

lost gust
#

That makes total sense! Thank you so much for making this tool, it's amazing!

wind jackal
#

❤️

grizzled stone
#

hi, i have tried to install the program but it appears this error No module named 'pyfiglet'

wind jackal
#

have you installed all requirements?

grizzled stone
#

i think so

wind jackal
#

pip install -r requirements.txt

grizzled stone
wind jackal
#

run that in the src folder

grizzled stone
wind jackal
#

after running the line I sent above?

grizzled stone
#

yes

#

also i have tried installing pyfiglet manually but I end up with the same error

wind jackal
#

That's weird you can also go in run.py and delete the line draw('Book'GPT')(2. line) in main()

#

since it is not essential

grizzled stone
#

ok im going to try that

wind jackal
#

Wait I will send you a edited version in dms

grizzled stone
#

oh, thank you 😉

wind jackal
#

no problem

grizzled stone
#

Excuse me for being a bother, it's my first time using python.

wind jackal
#

No problem at all 🙂

hollow ether
#

ohh snap this looks so cool... i have no idea what python is or how to use it so im goona go do some research before asking to many stupid questions on here.. but this is definately cool.

wind jackal
#

Thank you! There will probably soon be a website so stay tuned

raven gale
#

hey, this is amazing project, does it still has the limitation about the topics?

steel knoll
#

This application is awesome, do you have in mind to ad more topic in the future? Like:
1- Meditation
2- Weight Loss
3- Diet

random cedar
#

HI\

wind jackal
wind jackal
wind jackal
raven gale
wind jackal
raven gale
#

i see, so i can expect more categories in the future, thanks

wind jackal
#

Yes

main rose
#

File "run.py", line 31
print(f'[{i + 1}] {option}')
^
SyntaxError: invalid syntax
ubuntu@ln:~/BookGPT/src$

#

any help here?

torn light
#

how you are running it ?

#

python2 or 3

wind jackal
#

no problem

lost gust
main rose
#

correct it seems to use 2.7 even though i have 3.9 or greater installed

tired cypress
#

Is the pricing different for business and personal use?

nimble ruin
#

complete noob here, can anyone recommend a youtube tutorial that'll help me follow the README instructions?

wind jackal
#

Unfortunately there is no tutorial yet.

#

Do you have python installed?

nimble ruin
wind jackal
#

You basically just have to print the commands into the command prompt

#

Do you have any problem with a specific thing?

lament lava
#

In the doc on Github it says " The generated books will then be saved in the books folder and will be named after the title of the book." However my first generated book got saved as a single markdown file called book.md. Did I miss a step?

wind jackal
#

No this is a function I temporarily deleted

lost gust
main rose
#

i will try

split stag
#

Very Nice work Mika

#

Keep it up!!

wind jackal
#

Thanks

burnt lynx
#

This is pretty sick

#

I wonder how readable the books are

wind jackal
wind jackal
#

But in some of the next updates, I will fine tune the model more, so the book has better quality

torn light
#

@wind jackal I have lot of text data about my product. how can I use it to create User document for my product using GPT-3 ? Should fine-tune the model with data and then try creating the document ? How normally these kind of things are done ?

wind jackal
#

I don't exactly know what you mean

lapis copper
#

I got this error " You exceeded your current quota, please check your plan and billing details." Do we have to pay for ChatGPT to use it?

orchid venture
#

can i trie?

mellow kindle
obsidian lotus
#

Hello, First, Thanks for this Project. I tried to use it but Terminal tells me this : "You exceeded your current quota, please check your plan and billing details." ... Not sure I use all my quota. Anything I need to know ? Thx

wind jackal
obsidian lotus
#

None…

wind jackal
#

And how many times have you used your api key?

#

this month

obsidian lotus
#

Just regenerate one to be able to copy it.

wind jackal
#

So it was only once?

obsidian lotus
#

Yep !

wind jackal
#

Alright then it was just an openai error

obsidian lotus
#

Ok Mika. What do you think… need to wait a little bit ?

wind jackal
#

Yes maybe

obsidian lotus
#

Ok. Thanks for your advises. I will let you know.

wind jackal
#

👍

wind jackal
austere ember
#

Awesome 👍

wind jackal
#

Thanks

fast basin
#

steps to create an e-book

obsidian lotus
#

@wind jackal still have the same problem : "openai.error.RateLimitError: You exceeded your current quota, please check your plan and billing details." . What do y ou think ?

wind jackal
wind jackal
#

You have reached your free limit

flint hamlet
#

Hello. Thanks for your work. But I ran into a problem. In English, the program works fine, but when creating a book in another language (in particular, in Russian), in all categories, except for "History", the program creates only the title of the book. However, if you select the option: "historical book" - the generation occurs as it should.

wind jackal
#

That is weird. I will take a look into it, which may takes a while.

#

But thank you very much for the information

torn light
#

Sometime it is printing only title. Anyone faced this issue ?

#

ha.. above one..

wind jackal
#

Yes, this is apparently a bug. Hopefully I can fix that in the next version.

sweet sand
#

Hey @wind jackal , could you share your general policies for formatting prompt-completion pairs for fine-tuning the model for your program? I'm trying to process a lot of very long articles on a specific subject, to get GPT to be able to generate similar articles, rehashing the same information in a way that makes sense, kind of like what you've very impressively done here.

#

just wondering how you split up the text basically and what else you included in the prompts?

torn light
#

@sweet sand I think he hasnt use any fine-tune model for this..

wind jackal
full agate
#

This is great! I have noticed a few things though: It isn't always consistent with how many words it uses / chapter, like if i want 20 chapters and 2k words per chapter, there should be approx 40k words but it only did 25k words total (which is a lot, and maybe im just asking for too much. And this is the most words ive been able to get out of it). Also within the book there is some repitation, but for a large book completelly AI generated it does really well. And i have ran into the bug where it just prints the title a few times, but that only seemed to happen when i accidently pressed enter before i typed the language. Also it would be cool to be able to do fiction books, though that would be pretty complicated and i think you already have that idea and are probably working on it. But aside from those things this is really good.

wind jackal
#

Fiction books will also be added in one of the future version, but after I have the website for the project.

#

And what I noticed is, that it reaches the amount of words, if you for example let it create more chapters and less words per chapter.

wind jackal
#

Yes that was a small fixed. I haven‘t edited yet

full agate
# wind jackal And what I noticed is, that it reaches the amount of words, if you for example l...

So i have continued to create books and a problem is that i can't seem to make any books longer than 20 chapters, if I try to it will either just stop randomly at a chapter (like not even finish), just randomly be really short, like 6 chapters with even less text then i specified among other things (This does stop, but it just finishes the book really short, not cut it off). But if i do 20 chapters or below it seems to be ok, unless i do a big word count per chapter, like 5k.

wind jackal
#

I think the problem is that I limited the token size on the generation of the chapters

#

Will fix that when I get home

flint hamlet
#

Thanks for your works. Of course, it is most interesting to look at a fiction book written by the GPT. Here are a couple of ideas of what an algorithm for generating artistic text might look like.

  1. Creating a global book context:
    1.1) Genre selection
    1.2) Header selection
    1.3) Choice of text style
    1.4) Brief description of the plot from a person. Within one paragraph 100-500 characters.
    1.5) Generation of a description of the main characters of the book: names, appearance, biography, motives
    1.6) Generation of a description of the world of the book. Geography, historical era, characteristics
    1.7) Generation of a list of minor characters with a brief description of their appearance, biography
    1.8) Generation of a list of book chapters with a brief description of the events of each chapter.
    1.9) Global context generation: text within 1000 characters that summarizes everything to create a context for the GPT-3 neural network.
#
  1. Work on the chapter in order, in order of priority
    2.1) Considering the global context, we generate a detailed description of the events of the current chapter in 1-3 paragraphs (300-500 characters)
    2.2) Create a list of scenes taking place in the chapter. With a brief description of each scene in 1-3 paragraphs, given the global context of the novel.
    2.3) Create a chapter local context within 1000 characters, summing everything up for the GPT-3 neural network context.
    After creating a sequential description of the events in the next chapter and a list of scenes, we move on to step 3, which will include working on each scene, taking into account the global and local context.

  2. Work on the scene in order of priority. The list of scenes for each chapter is given by step 2.2.
    3.1) Identification of the main and secondary characters involved in the scene
    3.2) Description of the venue of the event: time of day, weather, description of the environment.
    3.3) Based on this information, taking into account all the previous text, the next paragraph is generated using GPT-3.
    After completing a scene, start working on the next scene.

full agate
#

^ Generating fiction books this way would be great, as it gives us a lot of customizability

#

Also I have been generating more books and i have noticed a few things. Repition isn't actually as bad as a problem as i thought it was. Another thing is that, as seen in the image attatched, there can often be too many paragraphs / chapter. This image contains just one page of a chapter (this chapter is about 3 and a half pages long), but on this single page there is 9 paragraphs, which can make the chapter feel a little disconected at times. Maybe it would be cool to have the option to specify how many paragraphs per chapter? (As different people have different prefeces as to how many paragraphs per chapter, and i prefer less paragraphs, but others proabably like more paragraphs) NOTE** the paragraphs aren't that big of a deal and are fine, but i would just like to personalize them lol

#

Also the chapters often start with words like "in addition, finally, in conclusion, to conclude", which makes it feel more like an essay than a book.

verbal talon
#

Hello Mika, Any chance you can make a YouTube video explain how to set this up for someone who doesn't know how to code? Sorry I'm a complete noob

wind jackal
wind jackal
wind jackal
native bough
#

I get "site-packages\openai\api_requestor.py", line 429, in _interpret_response_line
raise self.handle_error_response(
openai.error.RateLimitError: You exceeded your current quota, please check your plan and billing details."

#

But my CC is valid and alreay setup at openai

#

@wind jackal is this a bug?

#

nvm, it took another try and now it seems to work

dawn olive
#

I would like to start with Congratulations to MIKA for creating this program ! I'm fascinated with this technology , unfortunately when I hear Python I think of a Sneak ;___:
Is there a way for non IT realted person figure this program out ?

wind jackal
#

But a website is currently in developement

dawn olive
#

Awesome !

#

I'm a huge fan for people understanding this language and can make Machine with is learning at its own

#

Rocket science for me

#

I'll keep myself posted about your project ! Best wishes !

prisma glacier
#

how does this work?

wind jackal
wind jackal
tired cypress
#

@wind jackal hi...where and how do I enter key...wait 🥺 please lead me to how I can started on your book gpt. I'm a tiny bit lost in the gpt world🌎

#

@wind jackal thanks

wind jackal
#

In the config.json file in the src folder

coral mantle
#

This is so cool 🤩

ionic echo
craggy venture
#

Forensic Anthropology in deep Amazonia Jungle

final snow
#

I don’t have any book/ directory so it keeps writing over itself as book.md or book.html

wind jackal
#

Yes I changed that

wind jackal
candid atlas
#

Getting this error
File "run.py", line 31 print(f'[{i + 1}] {option}') ^ SyntaxError: invalid syntax

But I'm using python 2.7.18

#

Also tried python3 run.py and got even more error types

wind jackal
#

Have you tried python 3.9?

zinc blade
#

I’m still on 3.8

wind jackal
#

Yes 😄. There is already 3.10

zinc blade
#

Wdym isn’t 3.8 newer than 3.10

#

Or do I not understand the listing of new versions

#

:ABS_Floosh:

wind jackal
#

In this case the number ten is meant not one

zinc blade
#

Ohhh

#

Btw

quaint kite
#

After entering the language of the book as English, the terminal has been hanging ever since, probably been about 20 mins already. How long can this be expected to take? Feature request would be a progress bar of some sort, if possible, or at least some feedback like "generating chapter x".

#

Ok it finally finished,

Saving to markdown... Done.

Recommend listing the directory where the book gets saved to

#

Upon revising the generated book, it should have 36000 words (12 chapters x 3000 words per chapter), but the book has about 19000 words, less than half the amount.

wind jackal
#

There are still problems with a words per chapter amount above 1500

#

I will try to fix that

trail drift
#

Really great work. I'm sure it's a big ask but it looks like this project could be integrated with gpt_index to provide better context continuity. Also would help build an 'editor' function that can improve the book after the first draft.

slim elm
#

It would be very interesting to take what is already written and refine it with this tool, which already includes formatting from a draft.

wind jackal
fathom minnow
#

really cool. works amazing. already made a short story in spanish. the biography style works nicely for short bed time stories for kids.

wind jackal
chilly citrus
#

Hi, is there any kind of limitations for the usage per day?
Mine suddenly doesn't work after three books I made today (book.md only have the title and nothing else inside)

#

I have made sure my API not limited as well

#

Now I got the error like this, what might be the cause?

wind jackal
#

You can just try again

chilly citrus
#

ah i see, thanks for the info

#

I'm worried I might just broke something so I make sure first. Thanks!

sturdy moatBOT
#

@untold nimbus

Image generation is not available in this server.
To start generating images, click here.

south nest
#

@wind jackal Thank you for this one! Yesterday everything worked fine but now I will only get the title and nothing else. From my openai account I can see that it also just did 3 requests and none more.

south nest
#

If try to create from different titles everything works again

grave mist
#

hello

craggy nexus
wind jackal
#

what python version are you using

toxic path
#

so its not your script problem isnt ?

#

==============
i use
Latest Python
Latest releases version
tryin with 1 chapter 250 word self improvement

wind jackal
#

it doesn't matter what words you use. It means, that the openai severs are currently on high capacity. There isn't really anything you can do about it

compact burrow
#

en français ?

narrow phoenix
#

So are you planning to allow custom categories or will they be limited to a select set? For instance, if I wanted to generate a more research-focused generation on 'Evolution of Computing and the Rise of Conversational AI,’ would the Science category work as-is or would it need more prompt curation?

vale dragon
#

that's a cool project indeed

wind jackal
wind jackal
wind jackal
craggy nexus
# wind jackal what python version are you using

Thanks, I was able to get it to work after upgrading to Python 3.11. This is an excellent application. It generated two books for testing. But when I try now, I only get the title. The rest is coming to a halt. I don't get any errors either. Is it possible to print the error? Is it also possible to prefix the book filename with the title so that it does not get overwritten?

south nest
#

Why do I get 5 out of 10 times only a title in the book file? Is there a quick fix?

#

Python 3.9.13

chilly citrus
wind jackal
#

A little sneak peak of something I am currently working on

slow chasm
cyan rivet
gilded nimbus
#

@wind jackal This is a really interesting approach that you took. From what I saw in your code, you don't give any past context in the book to continue the generation. Have you tried using the previous paragraph or even a summary of the chapter and book so far? I think that there are solutions out there that don't involve having to use GPT for it.

echo ginkgo
#

it doesn't have the run.py file

#

@wind jackal

static panther
wind jackal
wind jackal
wind jackal
wind jackal
chilly citrus
#

Hello 🙂
Just want to share that the markdown mode keeps on listing only for the title without anything written for the last several request. What might cause it?

proud coral
#

love story

craggy nexus
#

Hello there! 😀
I just wanted to thank you for all of your hard work thus far; it has been greatly appreciated.
I wanted to discuss a few issues and new features I discovered in the programme. The first problem occurs when it fails to generate a book and instead generates a heading in the file. My OpenAI account shows that the credit has been used, so I believe this is due to OpenAI's busyness. I was thinking that keeping a temporary folder and putting whatever you grabbed in there might be useful. Another thing I noticed is that we should record each action in a file to help us understand the specific issues, the number of times we tried, and the credit used for each action.
In terms of new features, I believe it would be extremely beneficial if we could pass all of the chapter names and proceed from a specific chapter. This would allow us to save time and improve the efficiency of the process.
Just something I thought. Thank you once again.

broken oracle
#

also after that problem of having %50 empty only title files,

how to extent characters per chapter more than 1300?

wind jackal
#

I fixed the bug, with the book only printing the tile (hopefully). The newest version is on github. @broken oracle @craggy nexus and all other people that had the bug

stuck fjord
#

I just ran one of the examples in Grammarly Pro. The errors may be related to OpenAI and not your app, but it may be interesting to anyone anyways.

wind jackal
#

Very interesting! There is not much I can do against plagiarism, but I will build a grammar corrector using gpt edit.

#

Thank you

stable moss
#

First step on cloning the repository I get the following message: fatal: could not create work tree dir 'BookGPT': Permission denied

stuck fjord
mortal viper
#

What are the step by steps of how can I use this with no experience? I've never used github before

toxic path
#

Thanks Mika,
i just want to give some report, that the script give me 7 chapter meanwhile i just request 1 with 500 word

#

but the content is so far so good

#

maybe this info is useful for you

broken oracle
#

last pack errords

languid reef
#

Should work on Google colab? I can't run run.py

broken oracle
#

I don't want to say it but this app little bit disapointed me

rapid nexus
#

just added your project on braiain.com, looks like it's coming along

broken oracle
#

Is GPT-3 remembers the other paragraphs or even old chapters or it just generates something new everytime..

solemn hill
#

does the bot use the example files as a foundation? if yes couldnt i just make new folders and add more books for my private use?

random vector
#

will you keep updating the categories? If I can give you an idea of ​​a category, it would be general knowledge or something like that. I tried to write a book about Japanese legends, in the history category and he delivered a book very focused on the history of Japan, telling in which centuries the famous legends appeared and stuff like that. basically talking about the history of japan

smoky stream
#

how do i insert the API-key into the config.json file

cold idol
#

give me the title of a childrens book of a book with a naughty bumbble bee

sleek hollow
#

| __ ) ___ ___ | | / | _ _ |
| _ \ / _ \ / _ | |/ / | | |) || |
| |
) | (
) | (
) | <| |
| | / | |
|____/ _
/ _
/||_\_|| ||

Please select an option:
[1] Generate a book
[2] Exit

1
How many chapters should the book have?
4
How many words should each chapter have?
800
What is the category of the book?
Please select an option:
[1] Biography
[2] History
[3] Science
[4] SelfImprovement
[5] Travel
3
What is the topic of the book?
Computer Networks
What is the language of the book?
Englisch
Generating a book with 4 chapters, 800 words per chapter, topic "Computer Networks" and category "Science" in Englisch.
Initializing..
Title: "Exploring Computer Networks: A Comprehensive Guide to the Science and Technologies Behind the Networks of the Future"
Generate book..
Please select an option:
[1] Markdown
[2] HTML
3
Invalid option. Please try again.
2
Saving to HTML...
Done.

#

thats not normal is it

lyric topaz
#

Same experience for me. The program is generating blanks

sterile schooner
#

@wind jackal Hello very kind, if I wanted to dare to input a book that is about adventure, fantasy and a thousand other things, which of the categories should I click on? Then another question is, if I want to work on specific chapters by reviewing them together with api or chat is there a way? to make him add speeches and follow him step by step?

sterile schooner
# wind jackal

Then how could I have this screen and not the pc terminal? Finally, how do I input a more detailed plot? Sorry for the many questions but I'm very interested in this creation of yours and I'm a beginner, I hope to practice alone with your answers for better days

celest tendon
broken oracle
#

I am disapponinted from it because GPT-3 is not good enough to write books guys..

plain venture
#

hi

broken oracle
#

@wind jackal I think you can update this to write better 🙂

royal pelican
#

Can i add a specific style or tone to the code

limber comet
#

Very good idea!😆 👍

agile lagoon
dense wren
#

This is so cool I started using chat gpt to help me write a book been really good to bounce of ideas and get prompts! This would be the next step! Wow!

white wigeon
#

So what's it like to read this program generated book?

broken oracle
sturdy moatBOT
#

@broken oracle

sbluvbot's message blocked by AutoMod

We are committed to fostering a positive atmosphere and have implemented additional filters to block any inappropriate or disruptive language and topics.

full agate
upper lily
#

post some pdfs for us to read

wind jackal
royal pelican
royal pelican
#

I think I'm just wasting my tokens

#

I steel have quotas but it the programme show an error when generation the book regarding rate limits or time out problem. (This was only for a history book with 3 chapters and 300 words each). I don't even get an output to see where it stoped.

#

@wind jackal I think you should increase the timeout value

sturdy jungle
#

@wind jackal This is a great tool. I would like to implement this into a product I am working on called SimpliAi. I tested it out and works well. I would like to suggest the following future topics. Instead of hardcoding the prompts for a particular topic and asking which topic is desired. There can be a prompt to specify a topic and a prompt is generated which provides all the context necessary to create the topic. In addition, you can generate the full code necessary by templating the topics you have already using chatgpt. Just ask chatgpt to generalize a way to automatically create topics and list your few topics. But, to augment what you have will require alittle work so just future suggestion. I will probably be implementing this in a fork. In addition, I would like to take what you have and implement it on open source GPT alternatives like FLAN-T5. Please DM me if you would like to discuss.

gentle osprey
#

Traceback (most recent call last):
File "/Users/#myname/practice/BookGPT/src/run.py", line 2, in <module>
from pyfiglet import Figlet
ModuleNotFoundError: No module named 'pyfiglet'

#

how do i fix this

agile lagoon
#

@gentle osprey You have to execute this in the command prompt: pip install pyfiglet

nova torrent
#

Can you imagine adding this as an Automatic1111 extension, so that you can generate ai images for everything in the book, all while running your own version of Stable Diffusion locally on your machine? Man you are about to make a publisher out of every single person 😁

wind jackal
#

Also I am currently working on a version using ChatGPT, that is way more powerful and 10x cheaper

chilly citrus
#

seems like the development stopped?

wind jackal
wind jackal
#

No, it should still work.

chilly citrus
#

Oh, okay, sorry for the assumption... Glad to hear that 🙂

hazy fjord
#

Do I need python for this?

#

I dont understand the installation steps

chilly citrus
#

Yeah, you need it installed

#

You should googling about how to install and implement it in your machine

hazy fjord
#

ok thx

#

so before I do that. What can the program do so far? How many pages of a book can it produce?

chilly citrus
#

It is based on your input, since it asks you how much chapter you want in your book, and how many words per chapter

#

Well, it is not completely correct, since IIRC it has problems with more than 1500 words

hazy fjord
#

ok

#

I try to write a book using Chat GPT

#

Can the 1500 wordlimit be solved by using questions for it to answer?

#

Only way I can do it with ChatGPT is to use questions, use commands such as Describe/relate/associate/ and so on together with "be extensive" etc.

chilly citrus
#

uh, no... since it doesn't allow any further input once it started generating.

hazy fjord
#

What about of you use questions inserted to a chapter before generating?

chilly citrus
#

also the input is already quite "limited", in the sense of you're not chatting with this, rather than "fill in the blanks needed" type of thing

hazy fjord
#

There should be commands of questionere as imput for it to be valuable to use

#

can the creators develope this in this application?

chilly citrus
#

well you need to ask the developer for that

hazy fjord
#

who is the developer?

chilly citrus
#

@wind jackal , he/she just replied quite a moment ago

hazy fjord
#

thx!

#

@wind jackal Hey Mika, can u develope the app so that one can use questionere within each chapter? So that it answers questions for longer than 1500 word response?

chilly citrus
#

Actually, it is not "limited" per se, but the AI itself seems like having problems with that. I think it is caused by the OpenAI limitations of maximum token, but I could be wrong.

hazy fjord
#

Seems like a plausible explanation

#

It would be cool if one could have inputs like this: Answer question generally and extensively, Follow up on each statement and be specifik

#

that could generate the book(s) of life

chilly citrus
#

While waiting for it, I'd suggest for you to try installing it on your device first 👍

hazy fjord
#

Ok, thx!

#

where can i find the link to the instruction page and so on?

#

I cant find it anymore

#

found it

#

never mind

#

@chilly citrus I would be happy if you could help me alittle bit with Python. Which IDE / text editor do u suggest using for python?

chilly citrus
#

@hazy fjord Ahahaha, to be honest, I'm not a programmer as well, and I'm pretty limited in knowledge for this. I only install python on my device strictly for this app to be honest, so yeah, better ask someone else xD

wind jackal
#

The general problem is as @chilly citrus already said the max token amount. In the new version, the problem will unfortunately not be fixed, so the max word amount will approximately be 2000. But one major thing, that will be added is, that it has context between the paragraphs of a chapter, which increases the quality by far.

hazy fjord
#

ok stardust XD

wind jackal
#

The biggest step will be to implement it into a website, but I am still searching for a web dev for that.

hazy fjord
#

if it connects to premium where u can pay for tokens, couldnt the limitation be solved @wind jackal ?

chilly citrus
chilly citrus
wind jackal
chilly citrus
wind jackal
chilly citrus
hazy fjord
#

I have an API that I didnt pay for.

#

maybe im part of the science part of it. dunno

#

exactly Mika, thats how I solved it.

chilly citrus
#

basically, the max_token limitation is "set" by openai themselves. so, you couldn't bypass it using any openai's API

#

it is stated in their documentation

wind jackal
#

Yes, their model is trained on that token size, so it is not possible to bypass it. But there are some leaks, that there will be a model with 16k and 32k tokens in the future.

chilly citrus
#

hoo boy, 16k and 32k tokens

wind jackal
#

Yeah

#

That will be a game changer

chilly citrus
#

I mean, even with this "limitations", the output is already pretty great

#

Otherwise, ChatGPT won't reach 10M users in just a month 🤣

wind jackal
#

Yes and the quality of the gpt turbo version is twice as good as the current version imo

hazy fjord
#

Hmm. Iguess we would have to wait for API to be let loose for more tokens?

wind jackal
#

Yes

chilly citrus
#

Mannn, I really wished I have better knowledge for programming languages... 🤣

hazy fjord
#

how many letters is 1 token?

young stirrup
#

Ok so I am getting an error message that says keyerror: 'OpenAI_key' although, I have my open ai key clearly presented in my config.json

#

Don't really know what the issue is when I have my API key in my config file, I have to cd all the way to src, then do python run.py but it still doesnt work for some reason, just says there is an error on "json.load(f) ['OpenAI_key']"

young stirrup
#

nevermind, figured it out

#

How do I read the file, whenever I open html it just shows the title of the book, how do I read it in full? sorry I am new to this

young stirrup
#

Hmm ok well now its just stuck on "generate book..." I have tried this on two devices so far and it isnt generating a book

wind jackal
young stirrup
#

I tried multiple times because it just got stuck at generate book

#

Maybe 5 - 10 minutes for it to generate

#

The second time at least

#

The first time it generated really quick, but it just produced a title in html

#

It was just blank but now I got a full book, 8 chapters 2500 words for each

pale raven
#

My max length for the generated book is about 18 pages in pdf form, how many pages is yours?

wind jackal
full agate
wind jackal
full agate
#

I just rememberd I have actually gotten a book with more words (approx 35k) and it was 59 pages long lol

wind jackal
#

Yes, it depends on the font size

full agate
#

Yeah, and 35k words was the most i could get it to. I did try to get more but was unsuccessful. But i mean 35k words is really good

full agate
wind jackal
#

Yes but the problem right there is, that the paragraphs, in the chapter are not connected, for example the paragraphs start multiple times with „finally“. In the new version, the words per chapter limit will be about 2k words, but it will keep context in between the chapter, so the quality will be ten times better.

full agate
hazy fjord
#

I havent fixed python program but will when I get the time over. How ever, im curious to how you created the chapters of that book @full agate Did you just have a "title" for input or did u use a more comphrensive text for it to create the chapters and words?

hazy fjord
#

@wind jackal

#

@wind jackal Hello, im going to try to fix BookGPT. Could you be of service?

#

Any one else in here? I need help with the installation of the BookGPT into python, I cant clone the repository. Is it because its down or is it something wrong with the program?

smoky stream
#

Maybe this will be cool

languid anvil
hazy fjord
#

ok

#

Its my first time using it

#

@languid anvil is it wrong since its red text? Or what should I do?

languid anvil
hazy fjord
#

ok thx

#

i will try

#

where should I place the files?

languid anvil
hazy fjord
#

ok

#

I have created a map and extracted the files

#

Should I just open py again?

languid anvil
ancient jetty
#

Wow that’s really interesting because I’m literally working on something similar but different format haha 😆

languid anvil
#

whith pycharm like the last time

hazy fjord
#

Ok its opened

#

should I perform the same task in terminal?

#

ok

languid anvil
#

You have in other to add your api_credentials in the Json config (It's confidential, don't paste it here 😉 )

#

Last i will recommend you to paste the debug of your problem further directly on discord, due to the quality of image

hazy fjord
#

Where do I find the Json config? Is it in the python (Exe) map?

#

Like there is a config already? Or do I have to create one?

#

I dont know what you mean with further directly on discord

languid anvil
#

it's named 'config. json' in the src folder

hazy fjord
#

thx, I will see if I can figure it out

#

It tells me the same again

#

isnt this correcly put for the key?

#

should i clone it from the map source instead of the webpage?

#

it says the same if I clone from the map where the BookGPT is located

fierce bridge
#

What am I doing wrong?
I have pasted my api key in config.json
Do I need to do something else?

fierce bridge
young stirrup
#

It should be config.json

#

Also

#

I just kept trying

#

And then it properly formed the html

hazy fjord
#

Iguess we are all facing the same problem

#

I need help 😢

fierce bridge
#

But still facing the same problem

fierce bridge
hazy fjord
#

What does that mean?

#

Do I do that before I git the adress?

fierce bridge
#

write "cd (the path for the src folder)" first and then you can initiate run.py

wind jackal
#

Try it in your terminal/cmd

hazy fjord
#

can I use the terminal in Py?

#

or does it have to be cmd?

wind jackal
#

Do it in cmd, it is way easier and then just follow the steps on the github page

hazy fjord
#

ok, i will try

#

thx

#

same problem

wind jackal
#

You have to install git, or just donwload it from the github directly using the green button with "code" on it

hazy fjord
#

ok

#

thx

wind jackal
#

no problem

toxic path
#

script just stopped when waiting in generate book for long time, but api is used

hazy fjord
#

@wind jackal I downloaded it and put it in py map. It still doesnt work with the instructions

#

neither in CMD nor in python

dull atlas
hazy fjord
#

its aliiiiive

#

i got it to work boys

#

with aloty of ahelp of my friend duck

wind jackal
#

I updated the program to use the ChatGPT API. It is now way cheaper, has better context, better quality and better information.

#

If you already downloaded it you just have to redownload it.

eager garnet
#

hey @wind jackal can you dm me? i want to get this sold through our marketplace, its so sick rlly nice job with it haha

pale raven
#

getting this error:
openai.error.InvalidRequestError: This model's maximum context length is 4097 tokens. However, your messages resulted in 4109 tokens. Please reduce the length of the messages.

#

It was generating the book halfway through before it hit the above error

wind jackal
#

@pale raven Could you send me your parameters?

wind jackal
#

If anyone else had this issue, it is now resolved in version 0.8.1. You just need to re-download it.

daring shuttle
#

I just redownloaded it and unfortunuately still receiving the following error:
line 682, in _interpret_response_line
raise self.handle_error_response(
openai.error.InvalidRequestError: This model's maximum context length is 4097 tokens. However, your messages resulted in 4109 tokens. Please reduce the length of the messages.

wind jackal
#

What is you Words per chapter amount?

daring shuttle
#
  1. Additionally, the error seems to happen randomly with an experimentally deduced error chance of 32% every time a chapter finishes. I even got a book of 6 chapters with 2000 words parameter to output successfully after 7 tries.
wind jackal
#

Alright, I checked it now very carefully and it is just hitting the token limit, because of the context keeping. I would recommend setting the tolerance lower or setting a smaller word per chapter amount.

dull atlas
#

@wind jackal noticing a couple things with the new version

  • trying to generate 1 chapter. Always generates 5 chapters.
  • trying to generate 50 words for each chapter. Says it's going to generate between 150-300 words per paragraph

Is that what it is suppose to do?

wind jackal
#

But thank you really much for the feedback! @dull atlas

devout drift
#

That sounds fantastic, does it have long time memory?

wind jackal
#

Not yet, I am currently looking into pinecone.

devout drift
#

oh that would be great, I think especially for such large projects a biiiiig memory is absolutely essential to get a consistent story and writing style. Pinecone should be the best possibility for that atm.

wind jackal
devout drift
#

I have a lot of ideas I‘m currently developing how a coherent story writing could take place.
Is it possible to use gpt4 with your code and how is the gui you‘ve teased coming along? 😊

wind jackal
#

Tbh, I didn't develop it further, since I didn't find time for it

dull atlas
#

@wind jackal we see a lot of open ai timeout issues when making requests. Have you thought about implementing a backoff / retry strategy with the requests?

dull atlas
#

@wind jackal with your latest code we are seeing a lot of "This model's maximum context length is 4097" errors. Only can generate small books.

wind jackal
wind jackal
#

But that is expensive

dull atlas
wind jackal
devout drift
#

Unfortunately, I don't have gpt4 api access just yet... I'm still waiting for the relieving mail 🙂

wind jackal
devout drift
#

I hope so. I love 3.5 but since I'm messing with my 35 GPT4 prompts every 4 hours... I hardly can work with 3.5 anymore 🙂

wind jackal
devout drift
#

I have to use the chat for gpt4

dull atlas
wind jackal
dull atlas
wind jackal
unborn thunder
#

Great work! Is it possible to make it write in other languages than English?

dull atlas
#

@wind jackal why is it some generated books display "(5 paragraphs)" in the Chapter and then in the Paragraph displays "(250 words)" in the chapters and some don't. See example below

Chapter 4 (5 paragraphs): The Use of Rocks in Industry

Paragraph 1 (250 words): The industrial uses of rocks and their contribution to economic growth.

wind jackal
unborn thunder
#

@wind jackal Thank you!

wind jackal
wind jackal
dull atlas
#

Got it

grizzled iris
#

@wind jackal

nocturne quail
#

Can u add functionality to read pdf or files of other full books where I can cross reference and clone ideas on ur new book from?

wind jackal
devout rampart
#

'Traceback (most recent call last):
File "D:\ChatGPT\BookGPt\BookGPT\src\run.py", line 146, in <module>
main()
File "D:\ChatGPT\BookGPt\BookGPT\src\run.py", line 119, in main
structure, _ = book.get_structure()
File "D:\ChatGPT\BookGPt\BookGPT\src\book.py", line 51, in get_structure
self.chapters = self.convert_structure(self.structure)
File "D:\ChatGPT\BookGPt\BookGPT\src\book.py", line 141, in convert_structure
chapter_information[-1]['paragraphs'].append(
IndexError: list index out of range'

#

openai.error.InvalidRequestError: This model's maximum context length is 4097 tokens. However, your messages resulted in 4113 tokens. Please reduce the length of the messages.

#

Those are two seperate errors

bitter crow
#

Many tools will appear Ai powered, We need to stay in touch!!!, amazing

dawn musk
#

Sorry, I'm not sure what you mean by "!c". Can you please provide more details or clarify your request?I'm sorry, but I'm still not sure what you mean by "!c". If you have a request or question, please let me know how I can assist you.I'm sorry, but I'm not able to understand what you're trying to communicate with "!c". Can you please let me know what you need help with or what you're trying to say so I can assist you better?I apologize, but I still don't understand what you are trying to communicate with "!c". If there is something you need help with or a question you have, please let me know so I can assist you.I'm sorry, but I'm not able to understand what you are trying to communicate with "!c". If you need assistance with something, please let me know what you need help with and I'll do my best to assist you.I apologize, but I still don't understand what you are trying to communicate with "!c". If you need help with something or have a question, please let me know what it is so I can assist you.I'm sorry, but I'm still not able to understand what you're trying to communicate with "!c". If you have a request or question, please let me know what it is so I can assist you.I'm sorry, but I still aren't able to understand what you're trying to communicate with "!c". Can you please provide more information or clarify

#

Trying to get around the overloading with too many requests by putting in a check for token count and dropping old prompts as needed from the prompt. It generates without errors now. But it just piles on with lots of this quite frequently.

#

The biggest thing needed in this project is the over token issue needs to be fixed. I'd attempt it myself but the code is not particularly documented from a structure standpoint. I think it's trying to include everything in the chapter as context, but I may be misreading the code.

brittle perch
#

Hey @wind jackal, this is awesome! Any plans or roadmap for future versions?

wind jackal
wind jackal
dawn musk
brittle perch
brittle perch
faint mountain
#

does it have a doc reader in order to read the road map and story plot for a novel?

#

I've got road map for the whole story for GPT to use

devout rampart
#

Are there any updates to this? I find that many chapters don't generate and I'm navigatinga bunch of errors

naive holly
#

This is awesome!

full agate
#

Do you think you will update this with the new GPT-3.5-turbo-16k?

wind jackal
wild root
#

cool

full agate
#

GPT-4 turbo ? 🙂

cold ferry
#

Is the project dead?

sharp sequoia
#

Nice wrote a children's book for parents, waiting for publishing company to decide if it make money. First book i ever wrote and nailed it. Been working on book almost year to make it perfect or close as possible. thanks for program. Awesome Sauce!

shell pier
#

Hi is there a direct link to download this BookGPT?

edgy ridge
#

@wind jackal any plans for adding palm2?