# Specifying path where Sagemaker download the model

**URL:** </static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fspecifying-path-where-sagemaker-download-the-model%2F64741%3E%5C
**Category:** Amazon SageMaker\
**Created:** [December 6, 2023, 6:33am UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fspecifying-path-where-sagemaker-download-the-model%2F64741 "2023-12-06T06:33:33Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Soraheart1988](https://avatars.discourse-cdn.com/v4/letter/s/e9a140/32.png) [@Soraheart1988](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2FSoraheart1988)%5C
**Post date:** [December 6, 2023, 6:33am UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fspecifying-path-where-sagemaker-download-the-model%2F64741%2F1 "2023-12-06T06:33:33Z")

</div>

Hi, I am following t he CogVLM Model. [https://huggingface.co/THUDM/cogvlm-chat-hf](https://huggingface.co/THUDM/cogvlm-chat-hf)

I have spinup at sagemaker instance of ml.g4dn.12xlarge with 4x16 GPU.

I tried follow the code specified in above huggingface link, but face error at the _load\_checkpoint\_and\_dispatch_

> Blockquote  
> model = load\_checkpoint\_and\_dispatch(  
> model,  
> “~/.cache/huggingface/hub/models–THUDM–cogvlm-chat-hf/snapshots/54b93e0af3f1d8badcdeefdb0d26b1dfbc227f7a/”, # typical, ‘~/.cache/huggingface/hub/models–THUDM–cogvlm-chat-hf/snapshots/balabala’  
> device\_map=device\_map,  
> )

**This is the results of the !ls ~/.cache/huggingface/hub/models–THUDM–cogvlm-chat-hf/snapshots/54b93e0af3f1d8badcdeefdb0d26b1dfbc227f7a/**

config.json model-00005-of-00008.safetensors  
configuration\_cogvlm.py model-00006-of-00008.safetensors  
generation\_config.json model-00007-of-00008.safetensors  
model-00001-of-00008.safetensors model-00008-of-00008.safetensors  
model-00002-of-00008.safetensors modeling\_cogvlm.py  
model-00003-of-00008.safetensors model.safetensors.index.json  
model-00004-of-00008.safetensors visual.py

**This is the error message**  
ValueError: `checkpoint` should be the path to a file containing a whole state dict, or the index of a sharded checkpoint, or a folder containing a sharded checkpoint or the whole state dict, but got ~/.cache/huggingface/hub/models–THUDM–cogvlm-chat-hf/snapshots/54b93e0af3f1d8badcdeefdb0d26b1dfbc227f7a/.

Please advise how to fix it? Thanks
