CodeFuse-muAgent icon indicating copy to clipboard operation
CodeFuse-muAgent copied to clipboard

if all_embeddings[0].dtype == torch.bfloat16: IndexError: list index out of range

Open yuyaxiong opened this issue 5 months ago • 12 comments

Is there any emb model to suggestion for running the demo? if u can offer hf download path would be very nice. my error is this

Traceback (most recent call last):
  File "/data/yuyaxiong/project/demo/demo.py", line 53, in <module>
    cbh.import_code(do_interpret=do_interpret)
  File "/home/yuyaxiong/anaconda3/envs/mu_agent/lib/python3.10/site-packages/muagent/codechat/codebase_handler/codebase_handler.py", line 100, in import_code
    code_importer.import_code(static_analysis_res, interpretation, do_interpret=do_interpret)
  File "/home/yuyaxiong/anaconda3/envs/mu_agent/lib/python3.10/site-packages/muagent/codechat/codebase_handler/code_importer.py", line 43, in import_code
    self.interpretation_to_db(static_analysis_res, interpretation, do_interpret)
  File "/home/yuyaxiong/anaconda3/envs/mu_agent/lib/python3.10/site-packages/muagent/codechat/codebase_handler/code_importer.py", line 141, in interpretation_to_db
    emb = get_embedding(engine=self.embed_config.embed_engine, text_list=interp_list, model_path=self.embed_config.embed_model_path, embedding_device= self.embed_config.model_device, embed_config=self.embed_config)
  File "/home/yuyaxiong/anaconda3/envs/mu_agent/lib/python3.10/site-packages/muagent/llm_models/get_embedding.py", line 39, in get_embedding
    emb_res = hfe.get_emb(text_list)
  File "/home/yuyaxiong/anaconda3/envs/mu_agent/lib/python3.10/site-packages/muagent/llm_models/huggingface_embedding.py", line 36, in get_emb
    emb_res = self.model.embed_documents(text_list)
  File "/home/yuyaxiong/anaconda3/envs/mu_agent/lib/python3.10/site-packages/langchain_huggingface/embeddings/huggingface.py", line 87, in embed_documents
    embeddings = self.client.encode(
  File "/home/yuyaxiong/anaconda3/envs/mu_agent/lib/python3.10/site-packages/sentence_transformers/SentenceTransformer.py", line 565, in encode
    if all_embeddings[0].dtype == torch.bfloat16:
IndexError: list index out of range

yuyaxiong avatar Sep 04 '24 10:09 yuyaxiong