mshumer / gpt-author

MIT License
2.45k stars 354 forks source link

.epub not found #3

Closed MartinAbilev closed 1 year ago

MartinAbilev commented 1 year ago

after generation i can`t find where epub is saved or saved at all :D waste of my tokens damn :D

mshumer commented 1 year ago

Are you using Colab? If so, open the filesystem in the sidebar and it should be there!

MartinAbilev commented 1 year ago

I'm running in vs code Jupyter locally

mshumer commented 1 year ago

Ah, this might be the problem... so on Colab, typically, new files are stored in the content folder.

So adjust this part of the code:

for i, image in enumerate(data["artifacts"]):
      with open(f"/content/cover.png", "wb") as f: # replace this if running locally, to where you store the cover file
          f.write(base64.b64decode(image["base64"]))

and this part of the code:

create_epub(title, 'AI', chapter_titles, '/content/cover.png')

Change /content/cover.png to whatever makes sense for your filesystem.

MartinAbilev commented 1 year ago

I already disabled cover generation because it got already cover I want to put on.

mshumer commented 1 year ago

hmm, the next thing you can try is modifying epub.write_epub(f'{title}.epub', book) to specify the directory.

MartinAbilev commented 1 year ago

ou yeah now it saves as needed thanks :)

AgimaFR commented 1 year ago

@MartinAbilev If your problem is solved, don't forget to close the issue.