danf0 commited on
Commit
030c6ae
1 Parent(s): 40df7c3

Convert list back to array

Browse files
Files changed (1) hide show
  1. vendiscore.py +3 -3
vendiscore.py CHANGED
@@ -145,11 +145,11 @@ class VendiScore(evaluate.Metric):
145
  device="cpu",
146
  ):
147
  if score_K:
148
- vs = vendi.score_K(samples, normalize=normalize)
149
  elif score_dual:
150
- vs = vendi.score_dual(samples, normalize=normalize)
151
  elif score_X:
152
- vs = vendi.score_X(samples, normalize=normalize)
153
  elif type(k) == str and k == "ngram_overlap":
154
  vs = text_utils.ngram_vendi_score(
155
  samples, ns=ns, tokenizer=tokenizer
 
145
  device="cpu",
146
  ):
147
  if score_K:
148
+ vs = vendi.score_K(np.array(samples), normalize=normalize)
149
  elif score_dual:
150
+ vs = vendi.score_dual(np.array(samples), normalize=normalize)
151
  elif score_X:
152
+ vs = vendi.score_X(np.array(samples), normalize=normalize)
153
  elif type(k) == str and k == "ngram_overlap":
154
  vs = text_utils.ngram_vendi_score(
155
  samples, ns=ns, tokenizer=tokenizer