AnushS commited on
Commit
cd78c8f
·
1 Parent(s): 172309b

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +18 -3
README.md CHANGED
@@ -2,10 +2,8 @@
2
  license: apache-2.0
3
  tags:
4
  - generated_from_trainer
5
- metrics:
6
- - bleu
7
  model-index:
8
- - name: hieroglyph_unicode_translator_t5_small
9
  results: []
10
  ---
11
 
@@ -31,6 +29,23 @@ To Translate any sequence of hieroglyphs using this model, provide the following
31
 
32
  This model is a fine-tuned version of [t5-small](https://huggingface.co/t5-small) on a custom dataset derived from the [Dictionary of Middle Egyptian](https://archive.org/details/DictionaryOfMiddleEgyptian).
33
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
34
  ## Intended uses & limitations
35
 
36
  The Model is intended to be used to translate hieroglyphs.
 
2
  license: apache-2.0
3
  tags:
4
  - generated_from_trainer
 
 
5
  model-index:
6
+ - name: Hieroglyph-Translator-Using-Gardiner-Codes
7
  results: []
8
  ---
9
 
 
29
 
30
  This model is a fine-tuned version of [t5-small](https://huggingface.co/t5-small) on a custom dataset derived from the [Dictionary of Middle Egyptian](https://archive.org/details/DictionaryOfMiddleEgyptian).
31
 
32
+ The Inference Api on the hugging face model page doesn't work well, load the model in jupyter notebook using the following code snippet:
33
+
34
+ text = "" # add your hieroglyph gardiner code combination in the string
35
+
36
+ from transformers import AutoTokenizer
37
+
38
+ tokenizer = AutoTokenizer.from_pretrained("AnushS/hieroglyph_unicode_translator_t5_small")
39
+ inputs = tokenizer(text, return_tensors="pt").input_ids
40
+
41
+ from transformers import AutoModelForSeq2SeqLM
42
+
43
+
44
+ model = AutoModelForSeq2SeqLM.from_pretrained("AnushS/hieroglyph_unicode_translator_t5_small")
45
+ outputs = model.generate(inputs, max_new_tokens=40, do_sample=True, top_k=30, top_p=0.95)
46
+ translated_keywords = str(tokenizer.decode(outputs[0], skip_special_tokens=True))
47
+
48
+
49
  ## Intended uses & limitations
50
 
51
  The Model is intended to be used to translate hieroglyphs.