-
Notifications
You must be signed in to change notification settings - Fork 117
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
base: main
Are you sure you want to change the base?
Conversation
from PIL import Image | ||
|
||
from fasthtml.common import * | ||
from replicate import Client |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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
image_app_simple/main.py
Outdated
@@ -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)) |
There was a problem hiding this comment.
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
No description provided.