funmaker commited on
Commit
aba491d
·
verified ·
1 Parent(s): 4460f90

Update README.md

Browse files

Add trust_remote_code and specify bfloat16 precision for model loading

Files changed (1) hide show
  1. README.md +2 -2
README.md CHANGED
@@ -48,8 +48,8 @@ device = "cuda" if torch.cuda.is_available() else "cpu"
48
 
49
  # Load model and tokenizer
50
  model_id = "openbmb/InfLLM-V2-Short-Dense-Base"
51
- tokenizer = AutoTokenizer.from_pretrained(model_id)
52
- model = AutoModelForCausalLM.from_pretrained(model_id).to(device)
53
 
54
  # Create a prompt
55
  prompt = "The capital of France is"
 
48
 
49
  # Load model and tokenizer
50
  model_id = "openbmb/InfLLM-V2-Short-Dense-Base"
51
+ tokenizer = AutoTokenizer.from_pretrained(model_id, trust_remote_code=True)
52
+ model = AutoModelForCausalLM.from_pretrained(model_id,trust_remote_code=True).to(device,dtype=torch.bfloat16)
53
 
54
  # Create a prompt
55
  prompt = "The capital of France is"