shunxing1234
commited on
Commit
·
ef5f0c0
1
Parent(s):
8e91e9c
Update README.md
Browse files
README.md
CHANGED
@@ -57,17 +57,17 @@ For detailed version change history, see [Change Log](https://huggingface.co/BAA
|
|
57 |
from transformers import AutoTokenizer, AutoModelForCausalLM
|
58 |
import torch
|
59 |
|
60 |
-
model_info = "BAAI/
|
61 |
-
tokenizer = AutoTokenizer.from_pretrained(model_info, trust_remote_code=True)
|
62 |
-
model = AutoModelForCausalLM.from_pretrained(model_info, trust_remote_code=True)
|
63 |
model.eval()
|
64 |
-
model.to("cuda:
|
65 |
|
66 |
-
text = "
|
67 |
|
68 |
tokens = tokenizer.encode_plus(text)['input_ids'][:-1]
|
69 |
|
70 |
-
tokens = torch.tensor(tokens)[None,].to("cuda:
|
71 |
|
72 |
|
73 |
with torch.no_grad():
|
|
|
57 |
from transformers import AutoTokenizer, AutoModelForCausalLM
|
58 |
import torch
|
59 |
|
60 |
+
model_info = "BAAI/AquilaCode-multi"
|
61 |
+
tokenizer = AutoTokenizer.from_pretrained(model_info, trust_remote_code=True, use_auth_token='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')
|
62 |
+
model = AutoModelForCausalLM.from_pretrained(model_info, trust_remote_code=True, use_auth_token='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')
|
63 |
model.eval()
|
64 |
+
model.to("cuda:3")
|
65 |
|
66 |
+
text = "#补全代码\ndef quick_sort(x):"
|
67 |
|
68 |
tokens = tokenizer.encode_plus(text)['input_ids'][:-1]
|
69 |
|
70 |
+
tokens = torch.tensor(tokens)[None,].to("cuda:3")
|
71 |
|
72 |
|
73 |
with torch.no_grad():
|