lannelin commited on
Commit
c5c4329
1 Parent(s): 8959895

rm broken widget ex.

Browse files
Files changed (1) hide show
  1. README.md +3 -5
README.md CHANGED
@@ -8,8 +8,6 @@ datasets:
8
  - xnli
9
  metrics:
10
  - xnli
11
- widget:
12
- - text: "xnli: premise: ¿A quién vas a votar en 2020? hypothesis: Este ejemplo es política."
13
 
14
  ---
15
 
@@ -98,7 +96,7 @@ out = model.generate(**inputs, output_scores=True, return_dict_in_generate=True,
98
  # sanity check that our sequences are expected length (1 + start token + end token = 3)
99
  for i, seq in enumerate(out.sequences):
100
  assert len(
101
- seq) == 3, f"generated sequence {i} not of expected length, 3." \
102
  f" Actual length: {len(seq)}"
103
 
104
  # get the scores for our only token of interest
@@ -110,8 +108,8 @@ scores = out.scores[0]
110
  # sanity check that these labels are always the top 3 scoring
111
  for i, sequence_scores in enumerate(scores):
112
  top_scores = sequence_scores.argsort()[-3:]
113
- assert set(top_scores.tolist()) == set(label_inds), \
114
- f"top scoring tokens are not expected for this task." \
115
  f" Expected: {label_inds}. Got: {top_scores.tolist()}."
116
 
117
  # cut down scores to our task labels
8
  - xnli
9
  metrics:
10
  - xnli
 
 
11
 
12
  ---
13
 
96
  # sanity check that our sequences are expected length (1 + start token + end token = 3)
97
  for i, seq in enumerate(out.sequences):
98
  assert len(
99
+ seq) == 3, f"generated sequence {i} not of expected length, 3." \\
100
  f" Actual length: {len(seq)}"
101
 
102
  # get the scores for our only token of interest
108
  # sanity check that these labels are always the top 3 scoring
109
  for i, sequence_scores in enumerate(scores):
110
  top_scores = sequence_scores.argsort()[-3:]
111
+ assert set(top_scores.tolist()) == set(label_inds), \\
112
+ f"top scoring tokens are not expected for this task." \\
113
  f" Expected: {label_inds}. Got: {top_scores.tolist()}."
114
 
115
  # cut down scores to our task labels