o
    -i                     @   sf   d dl mZ d dlmZ d dlmZ d dlmZ dZdefddZ	edd	e
d
e
dB defddZdS )    )	lru_cache)PathN)global_http_connectionz5https://vllm-public-assets.s3.us-west-2.amazonaws.comreturnc                  C   s   t tj} | jddd | S )z8Get the path to the cache for storing downloaded assets.Tparentsexist_ok)r   envsVLLM_ASSETS_CACHEmkdir)path r   M/home/ubuntu/veenaModal/venv/lib/python3.10/site-packages/vllm/assets/base.pyget_cache_dir   s   
r   filename	s3_prefixc                 C   s\   t  d }|jddd ||  }| s,|dur|d |  } tjt d|  |tjd |S )zo
    Download an asset file from `s3://vllm-public-assets`
    and return the path to the downloaded file.
    vllm_public_assetsTr   N/)timeout)r   r   existsr   download_fileVLLM_S3_BUCKET_URLr	   VLLM_IMAGE_FETCH_TIMEOUT)r   r   asset_directory
asset_pathr   r   r   get_vllm_public_assets   s   
r   )N)	functoolsr   pathlibr   	vllm.envsr	   vllm.connectionsr   r   r   strr   r   r   r   r   <module>   s   "