radinplaid commited on
Commit
6398b11
·
verified ·
1 Parent(s): 0272b4a

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +10 -7
README.md CHANGED
@@ -48,22 +48,25 @@ See the `eole` model configuration in this repository for further details and th
48
 
49
  You must install the Nvidia cuda toolkit first, if you want to do GPU inference.
50
 
51
- Next, install the `quickmt` python library and download the model:
52
 
53
  ```bash
54
  git clone https://github.com/quickmt/quickmt.git
55
  pip install ./quickmt/
56
-
57
- quickmt-model-download quickmt/quickmt-en-ja ./quickmt-en-ja
58
  ```
59
 
60
- Finally use the model in python:
61
 
62
  ```python
63
  from quickmt import Translator
64
-
65
- # Auto-detects GPU, set to "cpu" to force CPU inference
66
- t = Translator("./quickmt-en-ja/", device="auto")
 
 
 
 
 
67
 
68
  # Translate - set beam size to 5 for higher quality (but slower speed)
69
  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.'
 
48
 
49
  You must install the Nvidia cuda toolkit first, if you want to do GPU inference.
50
 
51
+ Next, install the `quickmt` [python library](github.com/quickmt/quickmt).
52
 
53
  ```bash
54
  git clone https://github.com/quickmt/quickmt.git
55
  pip install ./quickmt/
 
 
56
  ```
57
 
58
+ Finally, use the model in python:
59
 
60
  ```python
61
  from quickmt import Translator
62
+ from huggingface_hub import snapshot_download
63
+
64
+ # Download Model (if not downloaded already) and return path to local model
65
+ # Device is either 'auto', 'cpu' or 'cuda'
66
+ t = Translator(
67
+ snapshot_download("quickmt/quickmt-en-ja", ignore_patterns="eole-model/*"),
68
+ device="cpu"
69
+ )
70
 
71
  # Translate - set beam size to 5 for higher quality (but slower speed)
72
  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.'