ubaada commited on
Commit
e79a50f
·
verified ·
1 Parent(s): 0beacf1

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +11 -1
README.md CHANGED
@@ -8,4 +8,14 @@ language:
8
  pipeline_tag: text2text-generation
9
  ---
10
 
11
- This is a huggingface port of the [PyTorch implementation of the original transformer](https://github.com/ubaada/scratch-transformer) model from 2017 introduced in the paper "[Attention Is All You Need](https://proceedings.neurips.cc/paper_files/paper/2017/file/3f5ee243547dee91fbd053c1c4a845aa-Paper.pdf)". This is the 65M parameter base model version trained to do English-to-German translations.
 
 
 
 
 
 
 
 
 
 
 
8
  pipeline_tag: text2text-generation
9
  ---
10
 
11
+ This is a huggingface port of the [PyTorch implementation of the original transformer](https://github.com/ubaada/scratch-transformer) model from 2017 introduced in the paper "[Attention Is All You Need](https://proceedings.neurips.cc/paper_files/paper/2017/file/3f5ee243547dee91fbd053c1c4a845aa-Paper.pdf)". This is the 65M parameter base model version trained to do English-to-German translations.
12
+
13
+ Usage:
14
+ ```python
15
+ model = AutoModel.from_pretrained("ubaada/original-transformer", trust_remote_code=True)
16
+ tokenizer = AutoTokenizer.from_pretrained("ubaada/original-transformer")
17
+ text = 'This is my cat'
18
+ output = model.generate(**tokenizer(text, return_tensors="pt", add_special_tokens=True, truncation=True, max_length=100))
19
+ tokenizer.decode(output[0], skip_special_tokens=True, clean_up_tokenization_spaces=True)
20
+ # Output: ' Das ist meine Katze.'
21
+ ```