FlagEmbedding
FlagEmbedding copied to clipboard
Add package_data for Visualized_BGE
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'
Nice ~ I have encountered same problem.
@JUNJIE99
这个修改看起来应该能正常运行,您怎么看?
@JUNJIE99 This issue is very critical and prevents the usage of visual bge.
Thanks for your contribution!