AnushS commited on
Commit
ea2be09
·
1 Parent(s): f399745

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +13 -12
README.md CHANGED
@@ -38,19 +38,20 @@ It achieves the following results on the evaluation set:
38
  This model is a fine-tuned version of t5-small on a custom dataset derived from the Dictionary of Middle Egyptian.
39
 
40
  The Inference Api on the hugging face model page doesn't work well, load the model in jupyter notebook using the following code snippet:
41
- text = "" # add your hieroglyph gardiner code combination in the string
42
 
43
- from transformers import AutoTokenizer
44
-
45
- tokenizer = AutoTokenizer.from_pretrained("AnushS/hieroglyph_unicode_translator_t5_small")
46
- inputs = tokenizer(text, return_tensors="pt").input_ids
47
-
48
- from transformers import AutoModelForSeq2SeqLM
49
-
50
-
51
- model = AutoModelForSeq2SeqLM.from_pretrained("AnushS/hieroglyph_unicode_translator_t5_small")
52
- outputs = model.generate(inputs, max_new_tokens=40, do_sample=True, top_k=30, top_p=0.95)
53
- translated_keywords = str(tokenizer.decode(outputs[0], skip_special_tokens=True))
 
 
54
 
55
 
56
  Intended uses & limitations
 
38
  This model is a fine-tuned version of t5-small on a custom dataset derived from the Dictionary of Middle Egyptian.
39
 
40
  The Inference Api on the hugging face model page doesn't work well, load the model in jupyter notebook using the following code snippet:
 
41
 
42
+ text = "" # add your hieroglyph gardiner code combination in the string
43
+
44
+ from transformers import AutoTokenizer
45
+
46
+ tokenizer = AutoTokenizer.from_pretrained("AnushS/hieroglyph_unicode_translator_t5_small")
47
+ inputs = tokenizer(text, return_tensors="pt").input_ids
48
+
49
+ from transformers import AutoModelForSeq2SeqLM
50
+
51
+
52
+ model = AutoModelForSeq2SeqLM.from_pretrained("AnushS/hieroglyph_unicode_translator_t5_small")
53
+ outputs = model.generate(inputs, max_new_tokens=40, do_sample=True, top_k=30, top_p=0.95)
54
+ translated_keywords = str(tokenizer.decode(outputs[0], skip_special_tokens=True))
55
 
56
 
57
  Intended uses & limitations