radinplaid commited on
Commit
66ef0a6
·
verified ·
1 Parent(s): ef779b4

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +10 -7
README.md CHANGED
@@ -49,22 +49,25 @@ See the `eole` model configuration in this repository for further details and th
49
 
50
  You must install the Nvidia cuda toolkit first, if you want to do GPU inference.
51
 
52
- Next, install the `quickmt` python library and download the model:
53
 
54
  ```bash
55
  git clone https://github.com/quickmt/quickmt.git
56
  pip install ./quickmt/
57
-
58
- quickmt-model-download quickmt/quickmt-en-de ./quickmt-en-de
59
  ```
60
 
61
- Finally use the model in python:
62
 
63
  ```python
64
  from quickmt import Translator
65
-
66
- # Auto-detects GPU, set to "cpu" to force CPU inference
67
- t = Translator("./quickmt-en-de/", device="auto")
 
 
 
 
 
68
 
69
  # Translate - set beam size to 5 for higher quality (but slower speed)
70
  sample_text = 'Dr. Ehud Ur, professor of medicine at Dalhousie University in Halifax, Nova Scotia and chair of the clinical and scientific division of the Canadian Diabetes Association cautioned that the research is still in its early days.'
 
49
 
50
  You must install the Nvidia cuda toolkit first, if you want to do GPU inference.
51
 
52
+ Next, install the `quickmt` [python library](github.com/quickmt/quickmt).
53
 
54
  ```bash
55
  git clone https://github.com/quickmt/quickmt.git
56
  pip install ./quickmt/
 
 
57
  ```
58
 
59
+ Finally, use the model in python:
60
 
61
  ```python
62
  from quickmt import Translator
63
+ from huggingface_hub import snapshot_download
64
+
65
+ # Download Model (if not downloaded already) and return path to local model
66
+ # Device is either 'auto', 'cpu' or 'cuda'
67
+ t = Translator(
68
+ snapshot_download("quickmt/quickmt-en-de", ignore_patterns="eole-model/*"),
69
+ device="cpu"
70
+ )
71
 
72
  # Translate - set beam size to 5 for higher quality (but slower speed)
73
  sample_text = 'Dr. Ehud Ur, professor of medicine at Dalhousie University in Halifax, Nova Scotia and chair of the clinical and scientific division of the Canadian Diabetes Association cautioned that the research is still in its early days.'