mirror of
https://github.com/hwchase17/langchain
synced 2024-11-04 06:00:26 +00:00
Same Project for Eval Runs (#8781)
This commit is contained in:
parent
c8f3615aa6
commit
1d68470bac
@ -71,7 +71,7 @@ class EvaluatorCallbackHandler(BaseTracer):
|
|||||||
client: Optional[Client] = None,
|
client: Optional[Client] = None,
|
||||||
example_id: Optional[Union[UUID, str]] = None,
|
example_id: Optional[Union[UUID, str]] = None,
|
||||||
skip_unfinished: bool = True,
|
skip_unfinished: bool = True,
|
||||||
project_name: Optional[str] = None,
|
project_name: Optional[str] = "evaluators",
|
||||||
**kwargs: Any,
|
**kwargs: Any,
|
||||||
) -> None:
|
) -> None:
|
||||||
super().__init__(**kwargs)
|
super().__init__(**kwargs)
|
||||||
|
@ -785,14 +785,12 @@ async def _callbacks_initializer(
|
|||||||
project_name=project_name, client=client, use_threading=False
|
project_name=project_name, client=client, use_threading=False
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
evaluator_project_name = f"{project_name}-evaluators" if project_name else None
|
|
||||||
if run_evaluators:
|
if run_evaluators:
|
||||||
callback = EvaluatorCallbackHandler(
|
callback = EvaluatorCallbackHandler(
|
||||||
client=client,
|
client=client,
|
||||||
evaluators=run_evaluators,
|
evaluators=run_evaluators,
|
||||||
# We already have concurrency, don't want to overload the machine
|
# We already have concurrency, don't want to overload the machine
|
||||||
max_workers=1,
|
max_workers=1,
|
||||||
project_name=evaluator_project_name,
|
|
||||||
)
|
)
|
||||||
callbacks.append(callback)
|
callbacks.append(callback)
|
||||||
evaluation_handler_collector.append(callback)
|
evaluation_handler_collector.append(callback)
|
||||||
@ -1081,7 +1079,6 @@ def _run_on_examples(
|
|||||||
tracer = LangChainTracer(
|
tracer = LangChainTracer(
|
||||||
project_name=project_name, client=client, use_threading=False
|
project_name=project_name, client=client, use_threading=False
|
||||||
)
|
)
|
||||||
evaluator_project_name = f"{project_name}-evaluators"
|
|
||||||
run_evaluators, examples = _setup_evaluation(
|
run_evaluators, examples = _setup_evaluation(
|
||||||
llm_or_chain_factory, examples, evaluation, data_type
|
llm_or_chain_factory, examples, evaluation, data_type
|
||||||
)
|
)
|
||||||
@ -1089,7 +1086,6 @@ def _run_on_examples(
|
|||||||
evalution_handler = EvaluatorCallbackHandler(
|
evalution_handler = EvaluatorCallbackHandler(
|
||||||
evaluators=run_evaluators or [],
|
evaluators=run_evaluators or [],
|
||||||
client=client,
|
client=client,
|
||||||
project_name=evaluator_project_name,
|
|
||||||
)
|
)
|
||||||
callbacks: List[BaseCallbackHandler] = [tracer, evalution_handler]
|
callbacks: List[BaseCallbackHandler] = [tracer, evalution_handler]
|
||||||
for i, example in enumerate(examples):
|
for i, example in enumerate(examples):
|
||||||
|
Loading…
Reference in New Issue
Block a user