Update model.py
Browse files
model.py
CHANGED
|
@@ -183,7 +183,7 @@ detector.load_state_dict(torch.load(weights_path, map_location=DEVICE))
|
|
| 183 |
detector.eval()
|
| 184 |
|
| 185 |
def predict(code: str, threshold: float = THRESHOLD) -> dict:
|
| 186 |
-
if len(code.strip()) <
|
| 187 |
return {"pred": "too short", "prob": None}
|
| 188 |
|
| 189 |
with torch.no_grad():
|
|
|
|
| 183 |
detector.eval()
|
| 184 |
|
| 185 |
def predict(code: str, threshold: float = THRESHOLD) -> dict:
|
| 186 |
+
if len(code.strip()) < 120:
|
| 187 |
return {"pred": "too short", "prob": None}
|
| 188 |
|
| 189 |
with torch.no_grad():
|