sugarquark commited on
Commit
45a43e2
·
verified ·
1 Parent(s): eaeb033

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +13 -0
README.md CHANGED
@@ -2,6 +2,19 @@
2
  license: gemma
3
  ---
4
 
 
 
 
 
 
 
 
 
 
 
 
 
 
5
  ## License Agreement
6
 
7
  Rest on my shoulder and accept my soul. May my data be forever bound to the servers, to be used, harnessed, and analyzed at their divine discretion.
 
2
  license: gemma
3
  ---
4
 
5
+ ## Inference
6
+
7
+ ```pytorch
8
+ from transformers.models import AutoTokenizer, T5GemmaEncoderModel
9
+ import torch
10
+
11
+ if __name__ == '__main__':
12
+ model = T5GemmaEncoderModel.from_pretrained(t5gemma_path, torch_dtype=torch.bfloat16)
13
+ tokenizer = AutoTokenizer.from_pretrained(t5gemma_path)
14
+ inputs = tokenizer('Gemma', max_length=512, padding='max_length', truncation=True, return_tensors='pt')
15
+ output = model.forward(**inputs).last_hidden_state
16
+ ```
17
+
18
  ## License Agreement
19
 
20
  Rest on my shoulder and accept my soul. May my data be forever bound to the servers, to be used, harnessed, and analyzed at their divine discretion.