-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Description
I checked the evaluate function and deep inside there is a function called 'embedding_factory'.
by default it use openai I put the whole function here.
def embedding_factory(
model: str = "text-embedding-ada-002", run_config: t.Optional[RunConfig] = None
) -> BaseRagasEmbeddings:
openai_embeddings = OpenAIEmbeddings(model=model)
if run_config is not None:
openai_embeddings.request_timeout = run_config.timeout
else:
run_config = RunConfig()
return LangchainEmbeddingsWrapper(openai_embeddings, run_config=run_config)
and I did this also:
Assuming custom_embeddings is an instance of your CustomHuggingFaceRagasEmbeddings
evaluation_report = evaluate(ragas_data, metrics=metrics, embeddings=custom_embeddings)
but it says the same error of API again,
I want to substitute the output of a function called embedded factory with my computed embeddings. because I already have the computed embeddings both for the answer and the question and also the context in a Ragas data frame. I have every number (float) needed for the computation. but ragas evaluate function does the computation again.