FlagEmbedding icon indicating copy to clipboard operation
FlagEmbedding copied to clipboard

Add package_data for Visualized_BGE

Open hotchpotch opened this issue 1 year ago • 2 comments
trafficstars

Currently, some files are missing, so installing the package with pip install FlagEmbedding does not enable the visual model to work.

We believe this issue arises because bpe_simple_vocab_16e6.txt.gz and model_configs/*.json for eva_clip are not included in the package when it is created.

Including these files in the package will resolve the error and allow it to run successfully.

Note that currently, if you use pip install and install the package from PyPI, you will likely encounter the following error.

import torch
from FlagEmbedding.visual.modeling import Visualized_BGE

model = Visualized_BGE(model_name_bge="BAAI/bge-m3", model_weight=visualized_m3_path)

with torch.no_grad():
    query_emb = model.encode(
        text="Are there sidewalks on both sides of the Mid-Hudson Bridge?"
    )
FileNotFoundError: [Errno 2] No such file or directory: '/home/hotchpotch/miniconda3/envs/py311/lib/python3.11/site-packages/FlagEmbedding/visual/eva_clip/bpe_simple_vocab_16e6.txt.gz'

hotchpotch avatar Jul 03 '24 00:07 hotchpotch

Nice ~ I have encountered same problem.

tpoisonooo avatar Jul 23 '24 07:07 tpoisonooo

@JUNJIE99

这个修改看起来应该能正常运行,您怎么看?

hotchpotch avatar Aug 10 '24 03:08 hotchpotch

@JUNJIE99 This issue is very critical and prevents the usage of visual bge.

fcakyon avatar Aug 28 '24 00:08 fcakyon

Thanks for your contribution!

JUNJIE99 avatar Aug 28 '24 02:08 JUNJIE99