
    Nj                         d dl Z d dlmZ d dlmZ d dlmZmZ  e j                  e	      Z
	 	 	 	 	 ddedededee   dz  d	edz  d
ededdfdZdedeeef   fdZy)    N)Path)Any)	ModelCardModelCardDatafolder_pathbase_model_namelicenselanguage
model_nametemplate_pathkwargsreturnc           
         t        |       } |xs | j                  }t        t              j                  |z  }t	        d||||g ddd|}t        j                  |t        |            }	|	j                  | dz         y)a  Create a model card and store it in the specified path.

    :param folder_path: The path where the model card will be stored.
    :param base_model_name: The name of the base model.
    :param license: The license to use.
    :param language: The language of the model.
    :param model_name: The name of the model to use in the Model Card.
    :param template_path: The path to the template.
    :param **kwargs: Additional metadata for the model card (e.g., model_name, base_model, etc.).
    )
embeddingszstatic-embeddingszsentence-transformers	model2vec)r   
base_modelr	   r
   tagslibrary_name)r   z	README.mdN )	r   name__file__parentr   r   from_templatestrsave)
r   r   r	   r
   r   r   r   	full_pathmodel_card_data
model_cards
             p/Users/ahmed/devFolder/Ultron/claude-voice/.venv/lib/python3.12/site-packages/model2vec/modelcards/modelcards.pycreate_model_cardr    
   s    & {#K/{//JX%%5I# "I  O ((IWJOOK+-.    readme_pathc                     | j                         st        j                  d|  d       i S t        j                  |       }|j
                  j                         }|st        j                  d       |S )z Get metadata from a README file.zREADME file not found in z. No model card loaded.z;File README.md exists, but was empty. No model card loaded.)existsloggerinfor   loaddatato_dict)r"   r   r(   s      r   get_metadata_from_readmer*   .   s_    /}<STU	,J%??224DQRKr!   )unknownmitNNzmodel_card_template.md)loggingpathlibr   typingr   huggingface_hubr   r   	getLogger__name__r%   r   listr    dictr*   r   r!   r   <module>r5      s       4			8	$
 %!%!1!/!/!/ !/ 3i$	!/
 d
!/ !/ !/ 
!/H	$ 	4S> 	r!   