Views
No views yet
1# T5 English ↔ German Translator
2
3This repository hosts a fine-tuned **T5 model** for **English ↔ German translation**. The model, training notebook, and interactive demo are maintained by [@chinesemusk](https://huggingface.co/chinesemusk).
4
5---
6
7## Model Information
8
9- **Architecture**: T5-small (Text-to-Text Transfer Transformer)
10- **Task**: English ↔ German Translation (seq2seq)
11- **Tokenizer**: SentencePiece (`spiece.model` + `tokenizer.json`)
12- **Training Code**: Available in this [Google Colab / GitHub notebook](https://github.com/Deon62/Eng-German-Translator-model/blob/main/translator.ipynb)
13- **Demo**: Interactive UI hosted via Gradio in my Hugging Face Space: [Kahnwald Translator Demo](https://huggingface.co/spaces/chinesemusk/Kahnwald)
14
15---
16
17## Use the Model
18
19Load and run translations with just a few lines:
20
21```python
22from transformers import AutoTokenizer, AutoModelForSeq2SeqLM
23
24model_id = "chinesemusk/t5-en-de-translator"
25tokenizer = AutoTokenizer.from_pretrained(model_id)
26model = AutoModelForSeq2SeqLM.from_pretrained(model_id)
27
28text = "This is an example."
29inputs = tokenizer(f"translate English to German: {text}", return_tensors="pt", truncation=True)
30outputs = model.generate(**inputs, max_length=60)
31
32print("EN:", text)
33print("DE:", tokenizer.decode(outputs[0], skip_special_tokens=True))transformers, datasets, and evaluate libraries.
---
### Summary of Inclusions:
- Clear breakdown of model architecture and task.
- GitHub link to your code/notebook for transparency and reproducibility.
- Live demo link via Hugging Face Space for interactive testing.
- Usage snippet for quick adoption.
- Caveats and purpose for better user awareness.
- Proper acknowledgments and references.