radinplaid commited on
Commit
62c8b5b
·
verified ·
1 Parent(s): cde8adc

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +12 -9
README.md CHANGED
@@ -48,7 +48,7 @@ This model was augmented with back-translated data and has improved translation
48
 
49
  ## Try it on our Huggingface Space
50
 
51
- Give it a try before downloading here: https://huggingface.co/spaces/quickmt/QuickMT-Demo
52
 
53
 
54
  ## Model Information
@@ -66,22 +66,25 @@ See the `eole` model configuration in this repository for further details and th
66
 
67
  You must install the Nvidia cuda toolkit first, if you want to do GPU inference.
68
 
69
- Next, install the `quickmt` python library and download the model:
70
 
71
  ```bash
72
  git clone https://github.com/quickmt/quickmt.git
73
- pip install -e ./quickmt/
74
-
75
- quickmt-model-download quickmt/quickmt-fr-en ./quickmt-fr-en
76
  ```
77
 
78
- Finally use the model in python:
79
 
80
  ```python
81
  from quickmt import Translator
82
-
83
- # Auto-detects GPU, set to "cpu" to force CPU inference
84
- mt = Translator("./quickmt-fr-en/", device="auto")
 
 
 
 
 
85
 
86
  # Translate - set beam size to 1 for faster speed (but lower quality)
87
  sample_text = "Le Dr Ehud Ur, professeur de médecine à l'Université Dalhousie de Halifax (Nouvelle-Écosse) et président de la division clinique et scientifique de l'Association canadienne du diabète, a averti que la recherche en était encore à ses débuts."
 
48
 
49
  ## Try it on our Huggingface Space
50
 
51
+ Give it a try before downloading here: https://huggingface.co/spaces/quickmt/QuickMT-gui
52
 
53
 
54
  ## Model Information
 
66
 
67
  You must install the Nvidia cuda toolkit first, if you want to do GPU inference.
68
 
69
+ Next, install the `quickmt` [python library](github.com/quickmt/quickmt).
70
 
71
  ```bash
72
  git clone https://github.com/quickmt/quickmt.git
73
+ pip install ./quickmt/
 
 
74
  ```
75
 
76
+ Finally, use the model in python:
77
 
78
  ```python
79
  from quickmt import Translator
80
+ from huggingface_hub import snapshot_download
81
+
82
+ # Download Model (if not downloaded already) and return path to local model
83
+ # Device is either 'auto', 'cpu' or 'cuda'
84
+ mt = Translator(
85
+ snapshot_download("quickmt/quickmt-fr-en", ignore_patterns="eole-model/*"),
86
+ device="cpu"
87
+ )
88
 
89
  # Translate - set beam size to 1 for faster speed (but lower quality)
90
  sample_text = "Le Dr Ehud Ur, professeur de médecine à l'Université Dalhousie de Halifax (Nouvelle-Écosse) et président de la division clinique et scientifique de l'Association canadienne du diabète, a averti que la recherche en était encore à ses débuts."