Update README.md
Browse files
README.md
CHANGED
|
@@ -38,7 +38,7 @@ model-index:
|
|
| 38 |
|
| 39 |
## Try it on our Huggingface Space
|
| 40 |
|
| 41 |
-
Give it a try before downloading here: https://huggingface.co/spaces/quickmt/QuickMT-
|
| 42 |
|
| 43 |
|
| 44 |
## Model Information
|
|
@@ -56,22 +56,25 @@ See the `eole` model configuration in this repository for further details and th
|
|
| 56 |
|
| 57 |
You must install the Nvidia cuda toolkit first, if you want to do GPU inference.
|
| 58 |
|
| 59 |
-
Next, install the `quickmt` python library
|
| 60 |
|
| 61 |
```bash
|
| 62 |
git clone https://github.com/quickmt/quickmt.git
|
| 63 |
pip install ./quickmt/
|
| 64 |
-
|
| 65 |
-
quickmt-model-download quickmt/quickmt-da-en ./quickmt-da-en
|
| 66 |
```
|
| 67 |
|
| 68 |
-
Finally use the model in python:
|
| 69 |
|
| 70 |
```python
|
| 71 |
from quickmt import Translator
|
| 72 |
-
|
| 73 |
-
|
| 74 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 75 |
|
| 76 |
# Translate - set beam size to 1 for faster speed (but lower quality)
|
| 77 |
sample_text = 'Dr. Ehud Ur, professor i medicin på Dalhousie University i Halifax, Nova Scotia, og formand for den kliniske og videnskabelige afdeling af Canadian Diabetes Association, advarede om at forskningen stadig er i dens tidlige stadier.'
|
|
|
|
| 38 |
|
| 39 |
## Try it on our Huggingface Space
|
| 40 |
|
| 41 |
+
Give it a try before downloading here: https://huggingface.co/spaces/quickmt/QuickMT-gui
|
| 42 |
|
| 43 |
|
| 44 |
## Model Information
|
|
|
|
| 56 |
|
| 57 |
You must install the Nvidia cuda toolkit first, if you want to do GPU inference.
|
| 58 |
|
| 59 |
+
Next, install the `quickmt` [python library](github.com/quickmt/quickmt).
|
| 60 |
|
| 61 |
```bash
|
| 62 |
git clone https://github.com/quickmt/quickmt.git
|
| 63 |
pip install ./quickmt/
|
|
|
|
|
|
|
| 64 |
```
|
| 65 |
|
| 66 |
+
Finally, use the model in python:
|
| 67 |
|
| 68 |
```python
|
| 69 |
from quickmt import Translator
|
| 70 |
+
from huggingface_hub import snapshot_download
|
| 71 |
+
|
| 72 |
+
# Download Model (if not downloaded already) and return path to local model
|
| 73 |
+
# Device is either 'auto', 'cpu' or 'cuda'
|
| 74 |
+
t = Translator(
|
| 75 |
+
snapshot_download("quickmt/quickmt-da-en", ignore_patterns="eole-model/*"),
|
| 76 |
+
device="cpu"
|
| 77 |
+
)
|
| 78 |
|
| 79 |
# Translate - set beam size to 1 for faster speed (but lower quality)
|
| 80 |
sample_text = 'Dr. Ehud Ur, professor i medicin på Dalhousie University i Halifax, Nova Scotia, og formand for den kliniske og videnskabelige afdeling af Canadian Diabetes Association, advarede om at forskningen stadig er i dens tidlige stadier.'
|