mirror of
https://git.mirrors.martin98.com/https://github.com/infiniflow/ragflow.git
synced 2025-08-12 05:48:58 +08:00
when qwen rerank model not return ok, raise exception to notice user (#3593)
### What problem does this PR solve? When calling the Qwen rerank model, if the model does not return correctly, an exception should be raised to notify the user, rather than simply returning a value of 0, as this would be confusing to the user. ### Type of change - [x] New Feature (non-breaking change which adds functionality)
This commit is contained in:
parent
a10c2f2eff
commit
875096384b
@ -452,4 +452,5 @@ class QWenRerank(Base):
|
||||
for r in resp.output.results:
|
||||
rank[r.index] = r.relevance_score
|
||||
return rank, resp.usage.total_tokens
|
||||
return rank, 0
|
||||
else:
|
||||
raise ValueError(f"Error calling QWenRerank model {self.model_name}: {resp.status_code} - {resp.text}")
|
||||
|
Loading…
x
Reference in New Issue
Block a user