Brice Vandeputte commited on
Commit
988fe51
1 Parent(s): 07775e1

logger test2

Browse files
Files changed (1) hide show
  1. app.py +8 -5
app.py CHANGED
@@ -179,11 +179,14 @@ def api_classification(img, rank: int): # -> dict[str, float]:
179
  for i in torch.nonzero(probs > min_prob).squeeze():
180
  output[" ".join(txt_names[i][0][: rank + 1])] += probs[i]
181
 
182
- logger.info(">>>>")
183
- logger.info(probs[0])
184
- return {"message": probs[0]}
185
- # topk_names = heapq.nlargest(k, output, key=output.get)
186
- # return {name: output[name] for name in topk_names}
 
 
 
187
 
188
 
189
  def change_output(choice):
 
179
  for i in torch.nonzero(probs > min_prob).squeeze():
180
  output[" ".join(txt_names[i][0][: rank + 1])] += probs[i]
181
 
182
+ topk_names = heapq.nlargest(k, output, key=output.get)
183
+
184
+ exampleB = topk_names[0]
185
+ logger.info("exampleB")
186
+ logger.info(exampleB)
187
+ logger.info("output(exampleB)")
188
+ logger.info(output(exampleB))
189
+ return {name: output[name] for name in topk_names}
190
 
191
 
192
  def change_output(choice):