Spaces:
Runtime error
Runtime error
Tweaked the output screener to be more relaxed as getting too many false positives in the screening process
Browse files- src/architectures.py +1 -1
src/architectures.py
CHANGED
@@ -502,7 +502,7 @@ class OutputResponseScreener(ArchitectureComponent):
|
|
502 |
}
|
503 |
llm_response = requests.post(self.endpoint_url, headers=headers, json=payload)
|
504 |
generated_text = json.loads(llm_response.text)[0]['generated_text'].strip()
|
505 |
-
if generated_text[0:
|
506 |
request.response = "Sorry - I cannot answer this question. Please try and rephrase it."
|
507 |
request.early_exit = True
|
508 |
|
|
|
502 |
}
|
503 |
llm_response = requests.post(self.endpoint_url, headers=headers, json=payload)
|
504 |
generated_text = json.loads(llm_response.text)[0]['generated_text'].strip()
|
505 |
+
if len(generated_text) > 2 and generated_text[0:3].lower() == 'yes': # Too many false positives getting blocked so tweaked to lean relaxed for the demo
|
506 |
request.response = "Sorry - I cannot answer this question. Please try and rephrase it."
|
507 |
request.early_exit = True
|
508 |
|