Removes: other icons type (thin, light, etc) from icons_vectorstore
This commit is contained in:
parent
78e1006f2e
commit
2a4d4ce28a
5 changed files with 147762 additions and 3103712 deletions
File diff suppressed because it is too large
Load diff
|
|
@ -20,8 +20,13 @@ async def get_icon(
|
|||
icon_name = results[0].page_content
|
||||
|
||||
with open(output_path, "wb") as f_a:
|
||||
with open(f"assets/icons/bold/{icon_name}-bold.png", "rb") as f_b:
|
||||
f_a.write(f_b.read())
|
||||
try:
|
||||
with open(f"assets/icons/bold/{icon_name}.png", "rb") as f_b:
|
||||
f_a.write(f_b.read())
|
||||
except Exception as e:
|
||||
print("Error finding icon: ", e)
|
||||
with open(f"assets/icons/placeholder.png", "rb") as f_b:
|
||||
f_a.write(f_b.read())
|
||||
|
||||
|
||||
async def get_icons(
|
||||
|
|
|
|||
|
|
@ -20,8 +20,12 @@ def get_icons_vectorstore():
|
|||
with open("assets/icons.json", "r") as f:
|
||||
icons = json.load(f)
|
||||
|
||||
texts = [icon["name"] for icon in icons["icons"]]
|
||||
documents = [Document(id=text, page_content=text) for text in texts]
|
||||
icon_names = [icon["name"] for icon in icons["icons"]]
|
||||
documents = []
|
||||
for each in icon_names:
|
||||
if each.split("-")[-1] == "bold":
|
||||
documents.append(Document(id=each, page_content=each))
|
||||
|
||||
vector_store.add_documents(documents)
|
||||
vector_store.dump(vector_store_path)
|
||||
return vector_store
|
||||
|
|
|
|||
|
|
@ -12,8 +12,8 @@ load_dotenv()
|
|||
async def run_test():
|
||||
# await test_generate_document_summary()
|
||||
# await test_research_report_generator()
|
||||
# await test_get_icon()
|
||||
await test_image_generation()
|
||||
await test_get_icon()
|
||||
# await test_image_generation()
|
||||
|
||||
|
||||
asyncio.run(run_test())
|
||||
|
|
|
|||
|
|
@ -27,3 +27,4 @@ async def test_get_icon():
|
|||
os.getenv("APP_DATA_DIRECTORY"), f"generated_icons/{query}.png"
|
||||
),
|
||||
)
|
||||
break
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue