Gengzigang commited on
Commit ·
b5d4148
1
Parent(s): 088b1e4
update
Browse files69 unmodified lines707172737475767778798081828369 unmodified linesmodel_name_or_path = "microsoft/LLM2CLIP-Openai-B-16" # or /path/to/local/LLM2CLIP-Openai-B-16model = AutoModel.from_pretrained(model_name_or_path,torch_dtype=torch.float16,trust_remote_code=True).to('cuda').eval()llm_model_name = 'microsoft/LLM2CLIP-Llama-3-8B-Instruct-CC-Finetuned'config = AutoConfig.from_pretrained(llm_model_name, trust_remote_code=True)llm_model = AutoModel.from_pretrained(llm_model_name, config=config,trust_remote_code=True)tokenizer = AutoTokenizer.from_pretrained(llm_model_name)llm_model.config._name_or_path = 'meta-llama/Meta-Llama-3-8B-Instruct' # Workaround for LLM2VECl2v = LLM2Vec(llm_model, tokenizer, pooling_mode="mean", max_length=512, doc_max_length=512)69 unmodified lines707172737475767778798081828369 unmodified linesmodel_name_or_path = "microsoft/LLM2CLIP-Openai-B-16" # or /path/to/local/LLM2CLIP-Openai-B-16model = AutoModel.from_pretrained(model_name_or_path,torch_dtype=torch.bfloat16,trust_remote_code=True).to('cuda').eval()llm_model_name = 'microsoft/LLM2CLIP-Llama-3-8B-Instruct-CC-Finetuned'config = AutoConfig.from_pretrained(llm_model_name, trust_remote_code=True)llm_model = AutoModel.from_pretrained(llm_model_name, torch_dtype=torch.bfloat16, config=config, trust_remote_code=True)tokenizer = AutoTokenizer.from_pretrained(llm_model_name)llm_model.config._name_or_path = 'meta-llama/Meta-Llama-3-8B-Instruct' # Workaround for LLM2VECl2v = LLM2Vec(llm_model, tokenizer, pooling_mode="mean", max_length=512, doc_max_length=512)
README.md+2-2