Text Generation
Transformers
PyTorch
xglm
kaddy-does-ml commited on
Commit
4955a98
1 Parent(s): 732d593

Updated the name of the variable data_samples_long to data_samples

Browse files

The code contained a dictionary named `data_samples`. The for loop in the original code looped over a variable named `data_samples_long` which throws a `NameError` exception because there is no variable named `data_samples_long` in the code snippet; it is supposed to be `data_samples` as defined earlier.

Files changed (1) hide show
  1. README.md +2 -2
README.md CHANGED
@@ -160,8 +160,8 @@ def COPA_eval(prompt, alternative1, alternative2):
160
  lprob2 = get_logprobs(prompt + "\n" + alternative2).sum()
161
  return 0 if lprob1 > lprob2 else 1
162
 
163
- for lang in data_samples_long:
164
- for idx, example in enumerate(data_samples_long[lang]):
165
  predict = COPA_eval(example["premise"], example["choice1"], example["choice2"])
166
  print(f'{lang}-{idx}', predict, example['label'])
167
 
 
160
  lprob2 = get_logprobs(prompt + "\n" + alternative2).sum()
161
  return 0 if lprob1 > lprob2 else 1
162
 
163
+ for lang in data_samples:
164
+ for idx, example in enumerate(data_samples[lang]):
165
  predict = COPA_eval(example["premise"], example["choice1"], example["choice2"])
166
  print(f'{lang}-{idx}', predict, example['label'])
167