config.json file missing

#1
by Ashmal - opened

zrthxn/vicuna-embedding does not appear to have a file named config.json. Checkout 'https://huggingface.co/zrthxn/vicuna-embedding/main' for available files.

Config file for this doesn't exist because this doesnt work with a existing HF model. You have to manually load the model and tokenizer.

Something like...

from torch import nn

# ...
tokenizer = LlamaTokenizer.from_pretrained("...")

# ...
embed = nn.Embedding(config.vocab_size, config.hidden_size, config.padding_idx)
with open(Path(base_path).joinpath("llama_embed.bin"), "rb") as f: 
         state_dict = torch.load(f, map_location=device) 
         
embed.load_state_dict(state_dict, strict=True)

Sign up or log in to comment