Procházet zdrojové kódy

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 před 11 měsíci
rodič
revize
875096384b
Žádný účet není propojen s e-mailovou adresou tvůrce revize
1 změnil soubory, kde provedl 2 přidání a 1 odebrání
  1. 2
    1
      rag/llm/rerank_model.py

+ 2
- 1
rag/llm/rerank_model.py Zobrazit soubor

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

Načítá se…
Zrušit
Uložit