Kareem94 commited on
Commit
7ce7217
·
verified ·
1 Parent(s): e9a0cfa

Update main.py

Browse files
Files changed (1) hide show
  1. main.py +2 -2
main.py CHANGED
@@ -134,7 +134,7 @@ def predict_batch():
134
  if len(validated_codes) == 1:
135
  score = predict_vulnerability_with_chunking(validated_codes[0])
136
  cleanup_gpu_memory()
137
- return jsonify({"results": [{"score": score}]})
138
 
139
  batch_size = min(len(validated_codes), 16)
140
  results = []
@@ -187,7 +187,7 @@ def predict_batch():
187
  batch_scores[local_idx] = 0.0
188
 
189
  for score in batch_scores:
190
- results.append({"score": score})
191
 
192
  cleanup_gpu_memory()
193
 
 
134
  if len(validated_codes) == 1:
135
  score = predict_vulnerability_with_chunking(validated_codes[0])
136
  cleanup_gpu_memory()
137
+ return jsonify({"results": [{"score": 1.0 - score}]})
138
 
139
  batch_size = min(len(validated_codes), 16)
140
  results = []
 
187
  batch_scores[local_idx] = 0.0
188
 
189
  for score in batch_scores:
190
+ results.append({"score": 1.0 - score})
191
 
192
  cleanup_gpu_memory()
193