Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
沈秋雨
/
weknora_ragas
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
Commit
463ef51b
...
463ef51b76d78ca7c99fd46eb1530d33ad9369a0
authored
2026-04-22 11:56:13 +0800
by
沈秋雨
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
Handle Ragas testset batch size compatibility
1 parent
7ce899a9
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
7 deletions
src/weknora_eval/testset.py
src/weknora_eval/testset.py
View file @
463ef51
...
...
@@ -2,6 +2,7 @@ from __future__ import annotations
import
json
import
logging
import
inspect
from
typing
import
Any
from
langchain_core.documents
import
Document
...
...
@@ -95,16 +96,17 @@ def generate_ragas_testset(
)
ragas_llm
,
ragas_embeddings
=
_wrap_langchain_models
(
llm
,
embeddings
)
generator
=
TestsetGenerator
(
llm
=
ragas_llm
,
embedding_model
=
ragas_embeddings
)
result
=
generator
.
generate_with_langchain_docs
(
documents
,
testset_size
=
size
,
run_config
=
RunConfig
(
generate_kwargs
:
dict
[
str
,
Any
]
=
{
"testset_size"
:
size
,
"run_config"
:
RunConfig
(
timeout
=
int
(
ragas_config
.
get
(
"timeout_seconds"
,
600
)),
max_workers
=
int
(
ragas_config
.
get
(
"max_workers"
,
1
)),
),
batch_size
=
1
,
raise_exceptions
=
False
,
)
"raise_exceptions"
:
False
,
}
if
"batch_size"
in
inspect
.
signature
(
generator
.
generate_with_langchain_docs
)
.
parameters
:
generate_kwargs
[
"batch_size"
]
=
1
result
=
generator
.
generate_with_langchain_docs
(
documents
,
**
generate_kwargs
)
ragas_rows
=
result
.
to_list
()
rows
=
_normalize_ragas_rows
(
ragas_rows
,
selected_source_rows
)
...
...
Please
register
or
sign in
to post a comment