beshiribrahim commited on
Commit
9022c8c
·
verified ·
1 Parent(s): f98328d

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +6 -3
README.md CHANGED
@@ -92,11 +92,13 @@ import torch
92
 
93
  device = "cuda" if torch.cuda.is_available() else "cpu"
94
 
95
- # load your Tigre-trained encoder
96
  model_id = "BeitTigreAI/tigre-sonar-encoder"
97
- seq2seq = M2M100ForConditionalGeneration.from_pretrained(model_id)
 
 
 
98
  encoder = seq2seq.get_encoder().to(device).eval()
99
- tokenizer = AutoTokenizer.from_pretrained(model_id)
100
 
101
  @torch.inference_mode()
102
  def embed(texts, lang):
@@ -115,6 +117,7 @@ def score_pair(tig, eng):
115
 
116
  print(score_pair("እት እድንየ እግል ትርኤ ተሐዜዮ ተቅዪር ግበእ", "Be the change that you wish to see in the world"))
117
  print(score_pair("ክል ዶል ኢገብእ መስል እስከ ይከለስ", "It always seems impossible until it's done"))
 
118
  ---
119
 
120
  ## License
 
92
 
93
  device = "cuda" if torch.cuda.is_available() else "cpu"
94
 
 
95
  model_id = "BeitTigreAI/tigre-sonar-encoder"
96
+ seq2seq = M2M100ForConditionalGeneration.from_pretrained(
97
+ model_id,
98
+ subfolder="model"
99
+ )
100
  encoder = seq2seq.get_encoder().to(device).eval()
101
+ tokenizer = AutoTokenizer.from_pretrained(model_id, subfolder="model")
102
 
103
  @torch.inference_mode()
104
  def embed(texts, lang):
 
117
 
118
  print(score_pair("እት እድንየ እግል ትርኤ ተሐዜዮ ተቅዪር ግበእ", "Be the change that you wish to see in the world"))
119
  print(score_pair("ክል ዶል ኢገብእ መስል እስከ ይከለስ", "It always seems impossible until it's done"))
120
+
121
  ---
122
 
123
  ## License