UMCU commited on
Commit
e788c0f
·
verified ·
1 Parent(s): d9d9e1f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -64,7 +64,7 @@ def fill_masked(text: str, model_name: str, top_k: int):
64
  "score": round(cand["score"], 4),
65
  "token": cand["token_str"]
66
  })
67
- res_dict[mask_num] = formatted
68
  elif isinstance(results, list):
69
  formatted = []
70
  for cand in results:
@@ -73,7 +73,7 @@ def fill_masked(text: str, model_name: str, top_k: int):
73
  "score": round(cand["score"], 4),
74
  "token": cand["token_str"]
75
  })
76
- res_dict[0] = formatted
77
  else:
78
  raise ValueError("The results need to be presented in a list or a list of lists")
79
  return res_dict
 
64
  "score": round(cand["score"], 4),
65
  "token": cand["token_str"]
66
  })
67
+ res_dict[f"mask_{str(mask_num)}"] = formatted
68
  elif isinstance(results, list):
69
  formatted = []
70
  for cand in results:
 
73
  "score": round(cand["score"], 4),
74
  "token": cand["token_str"]
75
  })
76
+ res_dict[f"mask_{str(0)}"] = formatted
77
  else:
78
  raise ValueError("The results need to be presented in a list or a list of lists")
79
  return res_dict