Transformers
PyTorch
TensorBoard
t5
text2text-generation
Generated from Trainer
text-generation-inference
Instructions to use AnushS/Hieroglyph-Translator-Using-Gardiner-Codes with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use AnushS/Hieroglyph-Translator-Using-Gardiner-Codes with Transformers:
# Load model directly from transformers import AutoTokenizer, AutoModelForSeq2SeqLM tokenizer = AutoTokenizer.from_pretrained("AnushS/Hieroglyph-Translator-Using-Gardiner-Codes") model = AutoModelForSeq2SeqLM.from_pretrained("AnushS/Hieroglyph-Translator-Using-Gardiner-Codes", device_map="auto") - Notebooks
- Google Colab
- Kaggle
Update README.md
Browse files
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:
|
| 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.
|