run-llama/finetune-embedding

Error when import `generate_qa_embedding_pairs` from `llama_index.finetuning`

Opened this issue · 2 comments

Trying to use generate_qa_embedding_pairs method to create synthetic data.

from llama_index.finetuning import generate_qa_embedding_pairs

I run into an error:

---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
Cell In[3], line 2
      1 import torch
----> 2 from llama_index.finetuning import generate_qa_embedding_pairs
      3 from llama_index.llms.openllm import OpenLLM
      4 from llama_index.llms.mistralai import MistralAI

File /mnt/team-shared/.venv/lib/python3.10/site-packages/llama_index/finetuning/__init__.py:13
      6 from llama_index.finetuning.embeddings.common import (
      7     EmbeddingQAFinetuneDataset,
      8     generate_qa_embedding_pairs,
      9 )
     10 from llama_index.finetuning.embeddings.sentence_transformer import (
     11     SentenceTransformersFinetuneEngine,
     12 )
---> 13 from llama_index.finetuning.gradient.base import GradientFinetuneEngine
     14 from llama_index.finetuning.openai.base import OpenAIFinetuneEngine
     15 from llama_index.finetuning.rerankers.cohere_reranker import (
     16     CohereRerankerFinetuneEngine,
     17 )

File /mnt/team-shared/.venv/lib/python3.10/site-packages/llama_index/finetuning/gradient/__init__.py:1
----> 1 from llama_index.finetuning.gradient.base import GradientFinetuneEngine
      3 __all__ = ["GradientFinetuneEngine"]
...
    702 self.__forward_evaluated__ = True`

File /mnt/team-shared/.venv/lib/python3.10/site-packages/llama_index/finetuning/gradient/__init__.py:1
----> 1 from llama_index.finetuning.gradient.base import GradientFinetuneEngine
      3 __all__ = ["GradientFinetuneEngine"]
...
    702 self.__forward_evaluated__ = True

File <string>:1

TypeError: conlist() got an unexpected keyword argument 'max_items'

Did you find the solution?

Found the solution here:

run-llama/llama_index#13014