Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

.epub not found #3

Closed
MartinAbilev opened this issue Jun 21, 2023 · 7 comments
Closed

.epub not found #3

MartinAbilev opened this issue Jun 21, 2023 · 7 comments

Comments

@MartinAbilev
Copy link

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

@mshumer
Copy link
Owner

mshumer commented Jun 21, 2023

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

@MartinAbilev
Copy link
Author

I'm running in vs code Jupyter locally

@mshumer
Copy link
Owner

mshumer commented Jun 21, 2023

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
Copy link
Author

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

@mshumer
Copy link
Owner

mshumer commented Jun 21, 2023

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

@MartinAbilev
Copy link
Author

ou yeah now it saves as needed thanks :)

@AgimaFR
Copy link

AgimaFR commented Jun 21, 2023

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants