radinplaid commited on
Commit
572f423
·
verified ·
1 Parent(s): 973f3e9

Update README.md

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