Spaces:
Running
Running
Merge branch 'main' into main
Browse files- README.md +3 -0
- translate.py +3 -1
README.md
CHANGED
|
@@ -139,3 +139,6 @@ accelerate launch eval.py \
|
|
| 139 |
```
|
| 140 |
|
| 141 |
If you want to save the results to a file use the `--output_path` flag.
|
|
|
|
|
|
|
|
|
|
|
|
| 139 |
```
|
| 140 |
|
| 141 |
If you want to save the results to a file use the `--output_path` flag.
|
| 142 |
+
|
| 143 |
+
See [sample_text/en2es.m2m100_1.2B.json](sample_text/en2es.m2m100_1.2B.json) for a sample output.
|
| 144 |
+
|
translate.py
CHANGED
|
@@ -64,7 +64,9 @@ def main(
|
|
| 64 |
if not os.path.exists(os.path.dirname(output_path)):
|
| 65 |
os.makedirs(os.path.dirname(output_path))
|
| 66 |
|
| 67 |
-
accelerator = Accelerator(
|
|
|
|
|
|
|
| 68 |
|
| 69 |
print("Loading tokenizer...")
|
| 70 |
tokenizer = M2M100Tokenizer.from_pretrained(
|
|
|
|
| 64 |
if not os.path.exists(os.path.dirname(output_path)):
|
| 65 |
os.makedirs(os.path.dirname(output_path))
|
| 66 |
|
| 67 |
+
accelerator = Accelerator(
|
| 68 |
+
mixed_precision=precision if precision != "32" else "no", split_batches=True
|
| 69 |
+
)
|
| 70 |
|
| 71 |
print("Loading tokenizer...")
|
| 72 |
tokenizer = M2M100Tokenizer.from_pretrained(
|