Views
No views yet
model_state_dict_1.binmodel_state_dict_2.binconfig.jsonmodel_state_dict_xxx.bin and config.json files.
Then you can inference the model like this:1from huggingface_hub import hf_hub_download
2from picture_to_music import PictureToMusicModel, PictureToMusicConfig
3import torch, json
4
5# Load config from hugging face
6config_path = hf_hub_download("Pesho564/Picture-to-music", "config.json")
7with open(config_path) as f:
8 config = json.load(f)
9
10config_class = PictureToMusicConfig(**config)
11
12device = torch.device('cuda' if torch.cuda.is_available() else 'cpu')
13
14# Load weights
15weights_path = hf_hub_download("Pesho564/Picture-to-music", "model_state_dict_1.bin")
16model = PictureToMusicModel(config_class).to(device)
17model.load_state_dict(torch.load(weights_path))
18
19model.eval()
20
21# Model is now ready