Jia Huei Tan
commited on
Commit
·
ca83acc
1
Parent(s):
b290091
Update README
Browse files
README.md
CHANGED
@@ -34,7 +34,13 @@ tokenizer = AutoTokenizer.from_pretrained(model_name)
|
|
34 |
model = ORTModelForFeatureExtraction.from_pretrained(
|
35 |
model_name, use_io_binding=True, provider=provider, device_map=device
|
36 |
)
|
37 |
-
inputs = tokenizer(
|
|
|
|
|
|
|
|
|
|
|
|
|
38 |
inputs = inputs.to(device)
|
39 |
token_embeddings = model(**inputs).last_hidden_state
|
40 |
# Pool
|
|
|
34 |
model = ORTModelForFeatureExtraction.from_pretrained(
|
35 |
model_name, use_io_binding=True, provider=provider, device_map=device
|
36 |
)
|
37 |
+
inputs = tokenizer(
|
38 |
+
sentences,
|
39 |
+
padding=True,
|
40 |
+
truncation=True,
|
41 |
+
return_tensors="pt",
|
42 |
+
max_length=model.config.max_position_embeddings,
|
43 |
+
)
|
44 |
inputs = inputs.to(device)
|
45 |
token_embeddings = model(**inputs).last_hidden_state
|
46 |
# Pool
|