hitting openai limits. moving to other models
This commit is contained in:
22
main.py
Normal file
22
main.py
Normal file
@@ -0,0 +1,22 @@
|
||||
from src.image_gen import image_style, icon_gen, Styles
|
||||
from src.llm_description_gen import describe_noun
|
||||
from pathlib import Path
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
with open("./data/imageable_deduplicate.txt", "r") as fp:
|
||||
nouns = fp.read().split("\n")
|
||||
|
||||
for i in range(55, 100):
|
||||
noun = nouns[i]
|
||||
print(f"image {noun} {i}")
|
||||
description = describe_noun(noun)
|
||||
content = str(description.content).lower()
|
||||
if "invalid" in content:
|
||||
continue
|
||||
|
||||
description_styled = image_style(content, style=Styles.cartoon)
|
||||
output_dir = f"./output/test1/{noun}"
|
||||
icon_gen(description_styled, quality="hd", model="dall-e-3", output=Path(output_dir))
|
||||
with open(Path(output_dir) / "description.txt", "w") as fp:
|
||||
fp.write(description_styled)
|
||||
Reference in New Issue
Block a user