Skip to content

revert tabels operations changes, optimize imports #40

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

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

matatratata
Copy link
Contributor

No description provided.

from PIL import Image

from fasthtml.common import *
from replicate import Client
Copy link
Contributor Author

@matatratata matatratata Sep 7, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fasthtml.common imports most of the modules. Among them - basics.replicate fn which can be confused with replicate module.

@@ -9,8 +9,8 @@

# gens database for storing generated image details
tables = database('data/gens.db').t
gens = tables.t.gens
if not gens in tables.t:
gens = tables.gens
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reverted changes - missed .t locally from line 11

@matatratata matatratata changed the title fix Table items creation with insert returns None id fix wrong commit, optimize imports Sep 8, 2024
@matatratata matatratata changed the title fix wrong commit, optimize imports revert tabels operations changes, optimize imports Sep 8, 2024
@@ -58,7 +58,7 @@ def static(fname:str, ext:str): return FileResponse(f'{fname}.{ext}')
def post(prompt:str):
folder = f"data/gens/{str(uuid.uuid4())}"
os.makedirs(folder, exist_ok=True)
g = gens.insert(Generation(prompt=prompt, folder=folder))
g = gens.insert(Generation(prompt=prompt, id=f"{gens.count}", folder=folder))
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

None was propagated, due to manual modules import. No longer an 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

Successfully merging this pull request may close these issues.

1 participant