mirror of
https://github.com/katanemo/plano.git
synced 2026-06-17 15:25:17 +02:00
Update Arch-Guard and corresponding e2e test
This commit is contained in:
parent
6dc92fbbc1
commit
2fd8a5a06d
2 changed files with 15 additions and 5 deletions
|
|
@ -105,7 +105,7 @@ class ArchGuardHanlder:
|
|||
sentence = None
|
||||
|
||||
return GuardResponse(
|
||||
prob=prob.item(), verdict=verdict, sentence=sentence, latency=latency
|
||||
prob=[prob.item()], verdict=verdict, sentence=[sentence], latency=latency
|
||||
)
|
||||
|
||||
def predict(self, req: GuardRequest, max_num_words=300) -> GuardResponse:
|
||||
|
|
@ -138,9 +138,9 @@ class ArchGuardHanlder:
|
|||
chunk_result = self._predict_text(req.task, chunk)
|
||||
|
||||
if chunk_result.verdict:
|
||||
prob.append(chunk_result.prob)
|
||||
prob.append(chunk_result.prob[0])
|
||||
verdict = True
|
||||
sentence.append(chunk_result.sentence)
|
||||
sentence.append(chunk_result.sentence[0])
|
||||
latency += chunk_result.latency
|
||||
|
||||
return GuardResponse(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue