how could fastembed load the local model?

Open
#549 4 comments 1 reaction 0 assignees View on GitHub

Maintainers usually reply within 4 days

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
25/100
Issue type
Feature
Clarity
Needs clarification
Activity status
Stale
Tech stack
python

Research direction

Start at the Python TextEmbedding constructor and the list_supported_models() entry point mentioned in the report. Check how model_name paths are validated and whether the local ModelScope path can be accepted; done means the supported local-loading behavior is clear and works for the reported model path.

Written by the indexing model from the issue text.

Description

since hf connection is not stable, I pre-download all the models needed in the local environment, how could I use the api to load these models ?

embedding_model = TextEmbedding(model_name='/root/.cache/modelscope/hub/models/BAAI/bge-small-en-v1.5')

but got an error saying

Traceback (most recent call last):
  File "/usr/opt/nky-ai/chat-agent/test.py", line 11, in <module>
    embedding_model = TextEmbedding(model_name='/root/.cache/modelscope/hub/models/BAAI/bge-small-en-v1.5') 
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/root/miniconda3/lib/python3.12/site-packages/fastembed/text/text_embedding.py", line 126, in __init__
    raise ValueError(
ValueError: Model /root/.cache/modelscope/hub/models/BAAI/bge-small-en-v1.5 is not supported in TextEmbedding. Please check the supported models using `TextEmbedding.list_supported_models()`

any idea ?

Dominant language
Python
Stars
3.3k
Forks
314
Avg merge
5d 7h
Merged PRs (30d)
23

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from qdrant/fastembed

All issues in qdrant/fastembed

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.