[Frontend] Score entrypoint support data_1 & data_2 and queries & documents as inputs (#32577)

Signed-off-by: wang.yuqi <yuqi.wang@daocloud.io>
This commit is contained in:
wang.yuqi
2026-01-19 22:07:46 +08:00
committed by GitHub
parent 758df5afe7
commit c88860d759
17 changed files with 277 additions and 137 deletions

View File

@@ -21,8 +21,8 @@ def parse_args():
def main(args: Namespace):
# Sample prompts.
text_1 = "What is the capital of France?"
texts_2 = [
query = "What is the capital of France?"
documents = [
"The capital of Brazil is Brasilia.",
"The capital of France is Paris.",
]
@@ -32,13 +32,13 @@ def main(args: Namespace):
llm = LLM(**vars(args))
# Generate scores. The output is a list of ScoringRequestOutputs.
outputs = llm.score(text_1, texts_2)
outputs = llm.score(query, documents)
# Print the outputs.
print("\nGenerated Outputs:\n" + "-" * 60)
for text_2, output in zip(texts_2, outputs):
for document, output in zip(documents, outputs):
score = output.outputs.score
print(f"Pair: {[text_1, text_2]!r} \nScore: {score}")
print(f"Pair: {[query, document]!r} \nScore: {score}")
print("-" * 60)