BAAI
/

shunxing1234 commited on
Commit
ef5f0c0
·
1 Parent(s): 8e91e9c

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +6 -6
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/Aquila-7B"
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:0")
65
 
66
- text = "汽车EDR是什么"
67
 
68
  tokens = tokenizer.encode_plus(text)['input_ids'][:-1]
69
 
70
- tokens = torch.tensor(tokens)[None,].to("cuda:0")
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():