radinplaid commited on
Commit
11f704b
·
verified ·
1 Parent(s): d05b79d

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +10 -7
README.md CHANGED
@@ -50,22 +50,25 @@ See the `eole` model configuration in this repository for further details and th
50
 
51
  You must install the Nvidia cuda toolkit first, if you want to do GPU inference.
52
 
53
- Next, install the `quickmt` python library and download the model:
54
 
55
  ```bash
56
  git clone https://github.com/quickmt/quickmt.git
57
  pip install ./quickmt/
58
-
59
- quickmt-model-download quickmt/quickmt-ur-en ./quickmt-ur-en
60
  ```
61
 
62
- Finally use the model in python:
63
 
64
  ```python
65
  from quickmt import Translator
66
-
67
- # Auto-detects GPU, set to "cpu" to force CPU inference
68
- t = Translator("./quickmt-ur-en/", device="auto")
 
 
 
 
 
69
 
70
  # Translate - set beam size to 1 for faster speed (but lower quality)
71
  sample_text = 'ہالیفیکس، نووا اسکاٹیا کی ڈلہوزی یونیورسٹی میں طب کے پروفیسر اور کینیڈین ڈائبیٹک ایسوسی ایشن کے طبی و سائنسی ڈویژن کے صدر ڈاکٹر ایہود یوآر نے متنبہ کیا ہے کہ تحقیق ابھی تک اپنے ابتدائی مراحل میں ہے۔'
 
50
 
51
  You must install the Nvidia cuda toolkit first, if you want to do GPU inference.
52
 
53
+ Next, install the `quickmt` [python library](github.com/quickmt/quickmt).
54
 
55
  ```bash
56
  git clone https://github.com/quickmt/quickmt.git
57
  pip install ./quickmt/
 
 
58
  ```
59
 
60
+ Finally, use the model in python:
61
 
62
  ```python
63
  from quickmt import Translator
64
+ from huggingface_hub import snapshot_download
65
+
66
+ # Download Model (if not downloaded already) and return path to local model
67
+ # Device is either 'auto', 'cpu' or 'cuda'
68
+ t = Translator(
69
+ snapshot_download("quickmt/quickmt-ur-en", ignore_patterns="eole-model/*"),
70
+ device="cpu"
71
+ )
72
 
73
  # Translate - set beam size to 1 for faster speed (but lower quality)
74
  sample_text = 'ہالیفیکس، نووا اسکاٹیا کی ڈلہوزی یونیورسٹی میں طب کے پروفیسر اور کینیڈین ڈائبیٹک ایسوسی ایشن کے طبی و سائنسی ڈویژن کے صدر ڈاکٹر ایہود یوآر نے متنبہ کیا ہے کہ تحقیق ابھی تک اپنے ابتدائی مراحل میں ہے۔'