Closed mechigonft closed 8 months ago
Please provide the relevant code
from towhee import AutoPipes, AutoConfig
config = AutoConfig.load_config('sentence_embedding') config.model = 'paraphrase-albert-small-v2' config.device = 0 sentence_embedding = AutoPipes.pipeline('sentence_embedding', config=config)
embedding = sentence_embedding('how are you?').get()
It works ok in my environment. Can your environment download Hugging Face models successfully?
hi, If I cannot download the model from hugging face, do I need to download it locally and specify it in the model path?
Can I load other vector models like bge-large-zh-1.5 which is not in your vector model list
Can I load other vector models like bge-large-zh-1.5 which is not in your vector model list
https://towhee.io/sentence-embedding/transformers Through this operation, more Hugging Face models can be invoked, including bge models.
hi, If I cannot download the model from hugging face, do I need to download it locally and specify it in the model path?
hi, If I cannot download the model from hugging face, do I need to download it locally and specify it in the model path?
You need to download huggingface model to the model cache, the default path is ~/.cache/huggingface/hub/
Does it have to be the default path, can I download the model to a different folder path and then specify this path in the code
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. Rotten issues close after 30d of inactivity. Close the stale issues and pull requests after 7 days of inactivity. Reopen the issue with /reopen
.
Is there an existing issue for this?
Current Behavior
File "/opt/conda/lib/python3.8/site-packages/towhee/runtime/auto_config.py", line 83, in load_config pipe_loader.PipelineLoader.load_pipeline(name) File "/opt/conda/lib/python3.8/site-packages/towhee/runtime/pipeline_loader.py", line 63, in load_pipeline if not PipelineLoader._load_builtins(name): File "/opt/conda/lib/python3.8/site-packages/towhee/runtime/pipeline_loader.py", line 52, in _load_builtins PipelineLoader._load_pipeline_from_file(name, file_path) File "/opt/conda/lib/python3.8/site-packages/towhee/runtime/pipeline_loader.py", line 45, in _load_pipeline_from_file spec.loader.exec_module(module) File "", line 843, in exec_module
File "", line 219, in _call_with_frames_removed
File "/opt/conda/lib/python3.8/site-packages/towhee/pipelines/sentence_embedding.py", line 33, in
_hf_models = ops.sentence_embedding.transformers().get_op().supported_model_names()
File "/opt/conda/lib/python3.8/site-packages/towhee/runtime/factory.py", line 109, in get_op
self.preload_op()
File "/opt/conda/lib/python3.8/site-packages/towhee/runtime/factory.py", line 119, in preload_op
raise RuntimeError(err) from e
RuntimeError: Loading operator with error:Load operator failed
Expected Behavior
File "/opt/conda/lib/python3.8/site-packages/towhee/runtime/auto_config.py", line 83, in load_config pipe_loader.PipelineLoader.load_pipeline(name) File "/opt/conda/lib/python3.8/site-packages/towhee/runtime/pipeline_loader.py", line 63, in load_pipeline if not PipelineLoader._load_builtins(name): File "/opt/conda/lib/python3.8/site-packages/towhee/runtime/pipeline_loader.py", line 52, in _load_builtins PipelineLoader._load_pipeline_from_file(name, file_path) File "/opt/conda/lib/python3.8/site-packages/towhee/runtime/pipeline_loader.py", line 45, in _load_pipeline_from_file spec.loader.exec_module(module) File "", line 843, in exec_module
File "", line 219, in _call_with_frames_removed
File "/opt/conda/lib/python3.8/site-packages/towhee/pipelines/sentence_embedding.py", line 33, in
_hf_models = ops.sentence_embedding.transformers().get_op().supported_model_names()
File "/opt/conda/lib/python3.8/site-packages/towhee/runtime/factory.py", line 109, in get_op
self.preload_op()
File "/opt/conda/lib/python3.8/site-packages/towhee/runtime/factory.py", line 119, in preload_op
raise RuntimeError(err) from e
RuntimeError: Loading operator with error:Load operator failed
Steps To Reproduce
No response
Environment
Anything else?
No response