Translation
English
Chinese
Eval Results (legacy)
radinplaid commited on
Commit
3f50616
·
verified ·
1 Parent(s): 2eea1bd

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +12 -9
README.md CHANGED
@@ -50,7 +50,7 @@ This model was trained with back-translated data and has improved translation qu
50
 
51
  ## Try it on our Huggingface Space
52
 
53
- Give it a try before downloading here: https://huggingface.co/spaces/quickmt/QuickMT-Demo
54
 
55
 
56
  ## Model Information
@@ -68,22 +68,25 @@ See the `eole` model configuration in this repository for further details and th
68
 
69
  You must install the Nvidia cuda toolkit first, if you want to do GPU inference.
70
 
71
- Next, install the `quickmt` python library and download the model:
72
 
73
  ```bash
74
  git clone https://github.com/quickmt/quickmt.git
75
- pip install -e ./quickmt/
76
-
77
- quickmt-model-download quickmt/quickmt-zh-en ./quickmt-zh-en
78
  ```
79
 
80
- Finally use the model in python:
81
 
82
  ```python
83
  from quickmt import Translator
84
-
85
- # Auto-detects GPU, set to "cpu" to force CPU inference
86
- t = Translator("./quickmt-zh-en/", device="auto")
 
 
 
 
 
87
 
88
  # Translate - set beam size to 1 for faster speed (but lower quality)
89
  sample_text = '埃胡德·乌尔博士(新斯科舍省哈利法克斯市达尔豪西大学医学教授,加拿大糖尿病协会临床与科学部门教授)提醒,这项研究仍处在早期阶段。'
 
50
 
51
  ## Try it on our Huggingface Space
52
 
53
+ Give it a try before downloading here: https://huggingface.co/spaces/quickmt/QuickMT-gui
54
 
55
 
56
  ## Model Information
 
68
 
69
  You must install the Nvidia cuda toolkit first, if you want to do GPU inference.
70
 
71
+ Next, install the `quickmt` [python library](github.com/quickmt/quickmt).
72
 
73
  ```bash
74
  git clone https://github.com/quickmt/quickmt.git
75
+ pip install ./quickmt/
 
 
76
  ```
77
 
78
+ Finally, use the model in python:
79
 
80
  ```python
81
  from quickmt import Translator
82
+ from huggingface_hub import snapshot_download
83
+
84
+ # Download Model (if not downloaded already) and return path to local model
85
+ # Device is either 'auto', 'cpu' or 'cuda'
86
+ mt = Translator(
87
+ snapshot_download("quickmt/quickmt-zh-en", ignore_patterns="eole-model/*"),
88
+ device="cpu"
89
+ )
90
 
91
  # Translate - set beam size to 1 for faster speed (but lower quality)
92
  sample_text = '埃胡德·乌尔博士(新斯科舍省哈利法克斯市达尔豪西大学医学教授,加拿大糖尿病协会临床与科学部门教授)提醒,这项研究仍处在早期阶段。'