Update README.md
Browse files
README.md
CHANGED
|
@@ -51,26 +51,25 @@ See the `eole-config.yaml` model configuration in this repository for further de
|
|
| 51 |
|
| 52 |
You must install the Nvidia cuda toolkit first, if you want to do GPU inference.
|
| 53 |
|
| 54 |
-
Next, install the `quickmt` python library
|
| 55 |
|
| 56 |
```bash
|
| 57 |
git clone https://github.com/quickmt/quickmt.git
|
| 58 |
pip install ./quickmt/
|
| 59 |
-
|
| 60 |
-
# List available models
|
| 61 |
-
quickmt-list
|
| 62 |
-
|
| 63 |
-
# Download a model
|
| 64 |
-
quickmt-model-download quickmt/quickmt-en-fr ./quickmt-en-fr
|
| 65 |
```
|
| 66 |
|
| 67 |
-
Finally use the model in python:
|
| 68 |
|
| 69 |
```python
|
| 70 |
from quickmt import Translator
|
| 71 |
-
|
| 72 |
-
|
| 73 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 74 |
|
| 75 |
# Translate - set beam size to 5 for higher quality (but slower speed)
|
| 76 |
sample_text = "The Virgo interferometer is a large-scale scientific instrument near Pisa, Italy, for detecting gravitational waves."
|
|
|
|
| 51 |
|
| 52 |
You must install the Nvidia cuda toolkit first, if you want to do GPU inference.
|
| 53 |
|
| 54 |
+
Next, install the `quickmt` [python library](github.com/quickmt/quickmt).
|
| 55 |
|
| 56 |
```bash
|
| 57 |
git clone https://github.com/quickmt/quickmt.git
|
| 58 |
pip install ./quickmt/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 59 |
```
|
| 60 |
|
| 61 |
+
Finally, use the model in python:
|
| 62 |
|
| 63 |
```python
|
| 64 |
from quickmt import Translator
|
| 65 |
+
from huggingface_hub import snapshot_download
|
| 66 |
+
|
| 67 |
+
# Download Model (if not downloaded already) and return path to local model
|
| 68 |
+
# Device is either 'auto', 'cpu' or 'cuda'
|
| 69 |
+
t = Translator(
|
| 70 |
+
snapshot_download("quickmt/quickmt-en-fr", ignore_patterns="eole-model/*"),
|
| 71 |
+
device="cpu"
|
| 72 |
+
)
|
| 73 |
|
| 74 |
# Translate - set beam size to 5 for higher quality (but slower speed)
|
| 75 |
sample_text = "The Virgo interferometer is a large-scale scientific instrument near Pisa, Italy, for detecting gravitational waves."
|