tripathysagar commited on
Commit
77b2b7e
·
verified ·
1 Parent(s): 993dbf9

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +13 -17
README.md CHANGED
@@ -35,28 +35,24 @@ This is the model card of a 🤗 transformers model that has been pushed on the
35
 
36
  ## Uses
37
 
38
- ```
39
- from huggingface_hub import snapshot_download
40
- snapshot_download(repo_id="tripathysagar/odia-gpt", local_dir='.')
41
-
42
- from model import GPT
43
- import os, torch
44
-
45
- from tokenizers import Tokenizer
46
- tokenizer = Tokenizer.from_file('tokenizer.json')
47
- nn, _ = GPT.from_file(os.path.join('model.pt'))
48
- nn = nn.to('cuda')
49
-
50
 
51
- s = 'କ୍ରେଡିଟ କାର୍ଡ ନେବା ସମୟରେ ଏହାର ସର୍ତ୍ତ ଏବଂ ନିୟମଗୁଡ଼ିକୁ ଧ୍ୟାନର ସହିତ ପଢ଼ିବା ଉଚିତ ।'
52
- print(tokenizer.encode(s))
53
- enc = torch.tensor(tokenizer.encode(s).ids).unsqueeze(0).to('cuda')
54
 
 
 
 
 
55
 
 
 
56
 
57
- op = nn.generate(enc, 50, top_k=50)
58
 
59
- print(tokenizer.decode(op[0].to('cpu').tolist()))
60
  ```
61
  ### Direct Use
62
 
 
35
 
36
  ## Uses
37
 
38
+ ```python
39
+ >>> from huggingface_hub import snapshot_download
40
+ >>> snapshot_download(repo_id="tripathysagar/odia-gpt", local_dir='.')
 
 
 
 
 
 
 
 
 
41
 
42
+ >>> from model import GPT
43
+ >>> import os, torch
 
44
 
45
+ >>> from tokenizers import Tokenizer
46
+ >>> tokenizer = Tokenizer.from_file('tokenizer.json')
47
+ >>> nn, _ = GPT.from_file(os.path.join('model.pt'))
48
+ >>> nn = nn.to('cuda')
49
 
50
+ >>> s = 'କ୍ରେଡିଟ କାର୍ଡ ନେବା ସମୟରେ ଏହାର ସର୍ତ୍ତ ଏବଂ ନିୟମଗୁଡ଼ିକୁ ଧ୍ୟାନର ସହିତ ପଢ଼ିବା ଉଚିତ ।'
51
+ >>> enc = torch.tensor(tokenizer.encode(s).ids).unsqueeze(0).to('cuda')
52
 
53
+ >>> op = nn.generate(enc, 50, top_k=50)
54
 
55
+ >>> print(tokenizer.decode(op[0].to('cpu').tolist()))
56
  ```
57
  ### Direct Use
58