Spaces:
Runtime error
Runtime error
Use BERT mini to generate file name embeddings
Browse filesFiles changed (3)
12323version https://git-lfs.github.com/spec/v1oid sha256:4c2758d74daff23f638acff398d1a512c74b97178118b7adbe8433ae8d368f52size 158848oid sha256:96904aebf90e27e7996692899b658ba8fcc0aa7cc6b67dc1c484d8afd7d33b4csize 31756834 unmodified lines353637383839404134 unmodified lines
LLM_PROGRESS_MAX = 90 ICONS_DIR = 'icons/png128/' TINY_BERT_MODEL = 'gaunernst/bert-tiny-uncased' TINY_BERT_MODEL = 'gaunernst/bert-mini-uncased' EMBEDDINGS_FILE_NAME = 'file_embeddings/embeddings.npy' ICONS_FILE_NAME = 'file_embeddings/icons.npy'
114 unmodified lines115116117118118119120121122123124125126127128129130131132133134135120136137138139140141142143144145146147148149150151152153154155156157158159160161162114 unmodified lines # Run this again if icons are to be added/removed save_icons_embeddings()
keywords = ['deep learning', 'library', 'universe', 'brain', 'cybersecurity', 'gaming', ''] keywords = [ 'deep learning', '', 'recycling', 'handshake', 'Ferry', 'rain drop', 'speech bubble', 'mental resilience', 'turmeric', 'Art', 'price tag', 'Oxygen', 'oxygen', 'Social Connection', 'Accomplishment', ] icon_files = find_icons(keywords) print(f'The relevant icon files are: {icon_files}') print( f'The relevant icon files are:\n' f'{list(zip(keywords, icon_files))}' )
# BERT tiny: # [('deep learning', 'deep-learning'), ('', '123'), ('recycling', 'refinery'), # ('handshake', 'dash-circle'), ('Ferry', 'cart'), ('rain drop', 'bucket'), # ('speech bubble', 'globe'), ('mental resilience', 'exclamation-triangle'), # ('turmeric', 'kebab'), ('Art', 'display'), ('price tag', 'bug-fill'), # ('Oxygen', 'radioactive')]
# BERT mini # [('deep learning', 'deep-learning'), ('', 'compass'), ('recycling', 'tools'), # ('handshake', 'bandaid'), ('Ferry', 'cart'), ('rain drop', 'trash'), # ('speech bubble', 'image'), ('mental resilience', 'recycle'), ('turmeric', 'linkedin'), # ('Art', 'book'), ('price tag', 'card-image'), ('Oxygen', 'radioactive')]
# BERT small # [('deep learning', 'deep-learning'), ('', 'gem'), ('recycling', 'tools'), # ('handshake', 'handbag'), ('Ferry', 'truck'), ('rain drop', 'bucket'), # ('speech bubble', 'strategy'), ('mental resilience', 'deep-learning'), # ('turmeric', 'flower'), # ('Art', 'book'), ('price tag', 'hotdog'), ('Oxygen', 'radioactive')]
if __name__ == '__main__':file_embeddings/embeddings.npy+2-2
global_config.py+1-1
helpers/icons_embeddings.py+41-2