Luigi commited on
Commit
f0d2ab7
·
1 Parent(s): 48e50b8

Test stopping criteria effectiveness

Browse files

- Temporarily modify CancelStoppingCriteria to always return True
- This will test if stopping criteria are being checked during generation
- If generation stops after first token, stopping criteria work; if not, they are ignored

Files changed (1) hide show
  1. app.py +1 -1
app.py CHANGED
@@ -28,7 +28,7 @@ cancel_event = threading.Event()
28
  # ------------------------------
29
  class CancelStoppingCriteria(StoppingCriteria):
30
  def __call__(self, input_ids, scores, **kwargs):
31
- return cancel_event.is_set()
32
 
33
  # ------------------------------
34
  # Torch-Compatible Model Definitions with Adjusted Descriptions
 
28
  # ------------------------------
29
  class CancelStoppingCriteria(StoppingCriteria):
30
  def __call__(self, input_ids, scores, **kwargs):
31
+ return True
32
 
33
  # ------------------------------
34
  # Torch-Compatible Model Definitions with Adjusted Descriptions