Find answers from the community

Home
Members
ilan_pinto
i
ilan_pinto
Offline, last seen 3 months ago
Joined September 25, 2024
i am having issues issues with index.as_query_engine() in runner.aevaluate_queries
i get this error
11 comments
L
i
i
ilan_pinto
·

Hi

Hi
I have loaded index from storage using :

index = load_index_from_storage(storage_context)
and then initiated a query engine

however when trying to use query engine:
egnine = index.as_query_engine(service_context=service_context)
egnine.query("What are deployment strategies used for in application development?")

i am getting the following error


File /opt/app-root/lib64/python3.9/site-packages/llama_index/embeddings/base.py:48, in similarity(embedding1, embedding2, mode)
46 return np.dot(embedding1, embedding2)
47 else:
---> 48 product = np.dot(embedding1, embedding2)
49 norm = np.linalg.norm(embedding1) * np.linalg.norm(embedding2)
50 return product / norm

ValueError: shapes (1536,) and (768,) not aligned: 1536 (dim 0) != 768 (dim 0)
1 comment
L
i
ilan_pinto
·

hi

hi
i am trying to use local llm
service_context = ServiceContext.from_defaults(chunk_size=512, chunk_overlap=10,embed_model='local',llm='local')

but i am getting this error
File ~/miniconda3/lib/python3.11/site-packages/llama_index/llms/llama_cpp.py:168, in LlamaCPP.metadata(self)
164 @property
165 def metadata(self) -> LLMMetadata:
166 """LLM metadata."""
167 return LLMMetadata(
--> 168 context_window=self._model.context_params.n_ctx,
169 num_output=self.max_new_tokens,
170 model_name=self.model_path,
171 )

AttributeError: 'Llama' object has no attribute 'context_params'
54 comments
L
i
t
need help with BatchEvalRunner
i tried to follow this example: https://docs.llamaindex.ai/en/stable/examples/evaluation/batch_eval/

this is my code
Plain Text
print("*** start evaluation")
    faithfulness = FaithfulnessEvaluator(service_context=service_context)
    relevancy = RelevancyEvaluator(service_context=service_context)
    correctness = CorrectnessEvaluator(service_context=service_context,score_threshold=2.0 ,parser_function=eval_parser)

    runner = BatchEvalRunner(
                                { "faithfulness": faithfulness, "relevancy": relevancy},
                                    workers=8, show_progress=True
                            )
    engine = index.as_query_engine()
    
    eval_results = await runner.aevaluate_queries( engine, queries=eval_questions.questions )


for some reason, i am getting the error below
Plain Text
Traceback (most recent call last):
  File "/Users/ilanpinto/dev/ai/lightspeed-rag-content/.conda/lib/python3.11/site-packages/llama_index/core/evaluation/batch_runner.py", line 268, in aevaluate_responses
    multi_kwargs = isinstance(next(iter(eval_kwargs_lists.values())), dict)
                              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
StopIteration
18 comments
L
i
d