radinplaid commited on
Commit
e9f0f0a
·
verified ·
1 Parent(s): 8f2eaf8

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +11 -8
README.md CHANGED
@@ -40,7 +40,7 @@ This is an updated, higher-quality model with a larger, cleaner training dataset
40
 
41
  ## Try it on our Huggingface Space
42
 
43
- Give it a try before downloading here: https://huggingface.co/spaces/quickmt/QuickMT-Demo
44
 
45
 
46
  ## Model Information
@@ -57,22 +57,25 @@ See the `eole` model configuration in this repository for further details and th
57
 
58
  You must install the Nvidia cuda toolkit first, if you want to do GPU inference.
59
 
60
- Next, install the `quickmt` python library and download the model:
61
 
62
  ```bash
63
  git clone https://github.com/quickmt/quickmt.git
64
  pip install ./quickmt/
65
-
66
- quickmt-model-download quickmt/quickmt-ru-en ./quickmt-ru-en
67
  ```
68
 
69
- Finally use the model in python:
70
 
71
  ```python
72
  from quickmt import Translator
73
-
74
- # Auto-detects GPU, set to "cpu" to force CPU inference
75
- t = Translator("./quickmt-ru-en/", device="auto")
 
 
 
 
 
76
 
77
  # Translate - set beam size to 1 for faster speed (but lower quality)
78
  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.'
 
40
 
41
  ## Try it on our Huggingface Space
42
 
43
+ Give it a try before downloading here: https://huggingface.co/spaces/quickmt/QuickMT-gui
44
 
45
 
46
  ## Model Information
 
57
 
58
  You must install the Nvidia cuda toolkit first, if you want to do GPU inference.
59
 
60
+ Next, install the `quickmt` [python library](github.com/quickmt/quickmt).
61
 
62
  ```bash
63
  git clone https://github.com/quickmt/quickmt.git
64
  pip install ./quickmt/
 
 
65
  ```
66
 
67
+ Finally, use the model in python:
68
 
69
  ```python
70
  from quickmt import Translator
71
+ from huggingface_hub import snapshot_download
72
+
73
+ # Download Model (if not downloaded already) and return path to local model
74
+ # Device is either 'auto', 'cpu' or 'cuda'
75
+ t = Translator(
76
+ snapshot_download("quickmt/quickmt-ru-en", ignore_patterns="eole-model/*"),
77
+ device="cpu"
78
+ )
79
 
80
  # Translate - set beam size to 1 for faster speed (but lower quality)
81
  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.'