Spaces:
Runtime error
Runtime error
Remove also the '{language}.sp.model' file on failure
Browse files
perplexity_lenses/perplexity.py
CHANGED
@@ -11,6 +11,7 @@ class KenlmModel:
|
|
11 |
self.model = kenlm.Model(f"{language}.arpa.bin")
|
12 |
except OSError:
|
13 |
os.remove(f"{language}.arpa.bin")
|
|
|
14 |
raise OSError("File was corrupt and should have been removed. Please, retry.")
|
15 |
|
16 |
@classmethod
|
|
|
11 |
self.model = kenlm.Model(f"{language}.arpa.bin")
|
12 |
except OSError:
|
13 |
os.remove(f"{language}.arpa.bin")
|
14 |
+
os.remove(f"{language}.sp.model")
|
15 |
raise OSError("File was corrupt and should have been removed. Please, retry.")
|
16 |
|
17 |
@classmethod
|