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
|
@@ -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 |
-
|
| 44 |
-
|
| 45 |
-
|
| 46 |
-
|
| 47 |
-
|
| 48 |
-
|
| 49 |
-
|
| 50 |
-
|
| 51 |
-
|
| 52 |
-
|
| 53 |
-
|
|
|
|
|
|
|
| 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
|