Gengzigang commited on
Commit
b5d4148
1 Parent(s): 088b1e4
Files changed (1) hide show
  1. README.md +2 -2
README.md CHANGED
@@ -70,14 +70,14 @@ processor = CLIPImageProcessor.from_pretrained("openai/openai/clip-vit-base-patc
70
  model_name_or_path = "microsoft/LLM2CLIP-Openai-B-16" # or /path/to/local/LLM2CLIP-Openai-B-16
71
  model = AutoModel.from_pretrained(
72
  model_name_or_path,
73
- torch_dtype=torch.float16,
74
  trust_remote_code=True).to('cuda').eval()
75
 
76
  llm_model_name = 'microsoft/LLM2CLIP-Llama-3-8B-Instruct-CC-Finetuned'
77
  config = AutoConfig.from_pretrained(
78
  llm_model_name, trust_remote_code=True
79
  )
80
- llm_model = AutoModel.from_pretrained(llm_model_name, config=config,trust_remote_code=True)
81
  tokenizer = AutoTokenizer.from_pretrained(llm_model_name)
82
  llm_model.config._name_or_path = 'meta-llama/Meta-Llama-3-8B-Instruct' # Workaround for LLM2VEC
83
  l2v = LLM2Vec(llm_model, tokenizer, pooling_mode="mean", max_length=512, doc_max_length=512)
 
70
  model_name_or_path = "microsoft/LLM2CLIP-Openai-B-16" # or /path/to/local/LLM2CLIP-Openai-B-16
71
  model = AutoModel.from_pretrained(
72
  model_name_or_path,
73
+ torch_dtype=torch.bfloat16,
74
  trust_remote_code=True).to('cuda').eval()
75
 
76
  llm_model_name = 'microsoft/LLM2CLIP-Llama-3-8B-Instruct-CC-Finetuned'
77
  config = AutoConfig.from_pretrained(
78
  llm_model_name, trust_remote_code=True
79
  )
80
+ llm_model = AutoModel.from_pretrained(llm_model_name, torch_dtype=torch.bfloat16, config=config, trust_remote_code=True)
81
  tokenizer = AutoTokenizer.from_pretrained(llm_model_name)
82
  llm_model.config._name_or_path = 'meta-llama/Meta-Llama-3-8B-Instruct' # Workaround for LLM2VEC
83
  l2v = LLM2Vec(llm_model, tokenizer, pooling_mode="mean", max_length=512, doc_max_length=512)