santh-cpu commited on
Commit
b8a9f6a
·
verified ·
1 Parent(s): fc37958

Update model.py

Browse files
Files changed (1) hide show
  1. model.py +1 -1
model.py CHANGED
@@ -184,7 +184,7 @@ detector.eval()
184
 
185
  def predict(code: str, threshold: float = THRESHOLD) -> dict:
186
  if len(code.strip()) < 200:
187
- return {"prediction": "Too Short", "ai_probability": None}
188
 
189
  with torch.no_grad():
190
  g = gen_tokenizer(code, return_tensors="pt", padding="max_length", truncation=True, max_length=MAX_LEN).to(DEVICE)
 
184
 
185
  def predict(code: str, threshold: float = THRESHOLD) -> dict:
186
  if len(code.strip()) < 200:
187
+ return {"pred": "too short", "prob": None}
188
 
189
  with torch.no_grad():
190
  g = gen_tokenizer(code, return_tensors="pt", padding="max_length", truncation=True, max_length=MAX_LEN).to(DEVICE)