Pārlūkot izejas kodu

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)
tags/v0.14.0
liwenju0 pirms 11 mēnešiem
vecāks
revīzija
875096384b
Revīzijas autora e-pasta adrese nav piesaistīta nevienam kontam
1 mainītis faili ar 2 papildinājumiem un 1 dzēšanām
  1. 2
    1
      rag/llm/rerank_model.py

+ 2
- 1
rag/llm/rerank_model.py Parādīt failu

@@ -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}")

Notiek ielāde…
Atcelt
Saglabāt