radinplaid commited on
Commit
33b35a7
ยท
verified ยท
1 Parent(s): f5f348f

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +10 -7
README.md CHANGED
@@ -51,22 +51,25 @@ See the `eole` model configuration in this repository for further details and th
51
 
52
  You must install the Nvidia cuda toolkit first, if you want to do GPU inference.
53
 
54
- Next, install the `quickmt` python library and download the model:
55
 
56
  ```bash
57
  git clone https://github.com/quickmt/quickmt.git
58
  pip install ./quickmt/
59
-
60
- quickmt-model-download quickmt/quickmt-ko-en ./quickmt-ko-en
61
  ```
62
 
63
- Finally use the model in python:
64
 
65
  ```python
66
  from quickmt import Translator
67
-
68
- # Auto-detects GPU, set to "cpu" to force CPU inference
69
- t = Translator("./quickmt-ko-en/", device="auto")
 
 
 
 
 
70
 
71
  # Translate - set beam size to 5 for higher quality (but slower speed)
72
  sample_text = '๋…ธ๋ฐ”์Šค์ฝ”์ƒค์ฃผ ํ•ผ๋ฆฌํŒฉ์Šค์˜ ๋Œˆํ•˜์šฐ์ง€๋Œ€ํ•™๊ต ์˜๊ณผ ๊ต์ˆ˜์ด์ž ์บ๋‚˜๋‹ค ๋‹น๋‡จ ํ˜‘ํšŒ ์ž„์ƒ๊ณผํ•™๋ถ€ ์˜์žฅ์ธ Ehud Ur ๋ฐ•์‚ฌ๋Š” ์ด ์—ฐ๊ตฌ๊ฐ€ ์•„์ง ์ดˆ๊ธฐ ๋‹จ๊ณ„๋ผ๊ณ  ๊ฒฝ๊ณ ํ–ˆ์Šต๋‹ˆ๋‹ค.'
 
51
 
52
  You must install the Nvidia cuda toolkit first, if you want to do GPU inference.
53
 
54
+ Next, install the `quickmt` [python library](github.com/quickmt/quickmt).
55
 
56
  ```bash
57
  git clone https://github.com/quickmt/quickmt.git
58
  pip install ./quickmt/
 
 
59
  ```
60
 
61
+ Finally, use the model in python:
62
 
63
  ```python
64
  from quickmt import Translator
65
+ from huggingface_hub import snapshot_download
66
+
67
+ # Download Model (if not downloaded already) and return path to local model
68
+ # Device is either 'auto', 'cpu' or 'cuda'
69
+ t = Translator(
70
+ snapshot_download("quickmt/quickmt-ko-en", ignore_patterns="eole-model/*"),
71
+ device="cpu"
72
+ )
73
 
74
  # Translate - set beam size to 5 for higher quality (but slower speed)
75
  sample_text = '๋…ธ๋ฐ”์Šค์ฝ”์ƒค์ฃผ ํ•ผ๋ฆฌํŒฉ์Šค์˜ ๋Œˆํ•˜์šฐ์ง€๋Œ€ํ•™๊ต ์˜๊ณผ ๊ต์ˆ˜์ด์ž ์บ๋‚˜๋‹ค ๋‹น๋‡จ ํ˜‘ํšŒ ์ž„์ƒ๊ณผํ•™๋ถ€ ์˜์žฅ์ธ Ehud Ur ๋ฐ•์‚ฌ๋Š” ์ด ์—ฐ๊ตฌ๊ฐ€ ์•„์ง ์ดˆ๊ธฐ ๋‹จ๊ณ„๋ผ๊ณ  ๊ฒฝ๊ณ ํ–ˆ์Šต๋‹ˆ๋‹ค.'