Spaces:
Build error
Build error
Update sescore.py
Browse files- sescore.py +1 -13
sescore.py
CHANGED
|
@@ -127,19 +127,7 @@ class SEScore(evaluate.Metric):
|
|
| 127 |
destination = snapshot_download(repo_id="xu1998hz/sescore_english_mt", revision="main")
|
| 128 |
self.scorer = load_from_checkpoint(f'{destination}/checkpoint/sescore_english_mt.ckpt')
|
| 129 |
else:
|
| 130 |
-
|
| 131 |
-
suffix = self.config_name.split('/')[-1]
|
| 132 |
-
print("suffix: ", suffix)
|
| 133 |
-
if suffix == 'sescore_english_mt':
|
| 134 |
-
self.scorer = load_from_checkpoint(f'{destination}/checkpoint/sescore_english_mt.ckpt')
|
| 135 |
-
elif suffix == 'sescore_german_mt':
|
| 136 |
-
self.scorer = load_from_checkpoint(f'{destination}/checkpoint/sescore_german.ckpt')
|
| 137 |
-
elif suffix == 'sescore_english_webnlg17':
|
| 138 |
-
self.scorer = load_from_checkpoint(f'{destination}/checkpoint/webnlg.ckpt')
|
| 139 |
-
elif suffix == 'sescore_english_coco':
|
| 140 |
-
self.scorer = load_from_checkpoint(f'{destination}/checkpoint/caption.ckpt')
|
| 141 |
-
else:
|
| 142 |
-
self.scorer = load_from_checkpoint(f'{destination}/checkpoint/{suffix}.ckpt')
|
| 143 |
|
| 144 |
def _compute(self, predictions, references, gpus=None, progress_bar=False):
|
| 145 |
if gpus is None:
|
|
|
|
| 127 |
destination = snapshot_download(repo_id="xu1998hz/sescore_english_mt", revision="main")
|
| 128 |
self.scorer = load_from_checkpoint(f'{destination}/checkpoint/sescore_english_mt.ckpt')
|
| 129 |
else:
|
| 130 |
+
print("Config name is not supported!")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 131 |
|
| 132 |
def _compute(self, predictions, references, gpus=None, progress_bar=False):
|
| 133 |
if gpus is None:
|