+
    &j@                        ^ RI t ^ RIt^ RIHt ^ RIHtHt ^ RIHt ^ RI	H
t
 ^ RIHtHt ^ RIHt ^ RIHtHtHtHt ^R	IHtHt ]P0                  ! ]4      tR(R
 R lltR(R R lltRtR]! 4        R]! 4        R]! 4        R2tR R ltR R lt R)R R llt!]R)R R ll4       t"]RRRRRRRRR RR!RR"RR#RR$RR%R/
R& R' ll4       t#R# )*    NPath)DEFAULT_PROTOCOLPicklingError)Any)version)	constantssnapshot_download)HfApi)SoftTemporaryDirectoryget_fastai_versionget_fastcore_versionget_python_version)loggingvalidate_hf_hub_argsc                0    V ^8  d   QhR\         R\         /# )   fastai_min_versionfastcore_min_versionstr)formats   "t/Users/jameslopez/projects/CWCArchive/cwc-podcast/.venv/lib/python3.14/site-packages/huggingface_hub/fastai_utils.py__annotate__r      s     ,
 ,
,
,
    c                   \        4       ;'       g    \        4       R8X  d)   \        RV  RV R\        4        R\        4        R2	4      h\        P                  ! \        4       4      p\        P                  ! \        4       4      pV\        P                  ! V 4      8  d   \        RV  R\        4        R	24      hV\        P                  ! V4      8  d   \        R
V R\        4        R24      hR# )a  
Checks that the installed fastai and fastcore versions are compatible for pickle serialization.

Args:
    fastai_min_version (`str`, *optional*):
        The minimum fastai version supported.
    fastcore_min_version (`str`, *optional*):
        The minimum fastcore version supported.

> [!TIP]
> Raises the following error:
>
>     - [`ImportError`](https://docs.python.org/3/library/exceptions.html#ImportError)
>       if the fastai or fastcore libraries are not available or are of an invalid version.
zN/Azfastai>=z and fastcore>=z' are required. Currently using fastai==z and fastcore==.zD`push_to_hub_fastai` and `from_pretrained_fastai` require a fastai>=z+ version, but you are using fastai version zA which is incompatible. Upgrade with `pip install fastai==2.5.6`.zF`push_to_hub_fastai` and `from_pretrained_fastai` require a fastcore>=- version, but you are using fastcore version zD which is incompatible. Upgrade with `pip install fastcore==1.3.27`.N)r   r   ImportErrorr   Version)r   r   current_fastai_versioncurrent_fastcore_versions   &&  r   _check_fastai_fastcore_versionsr#      s   ( 	66"4"65@)*/:N9O P22D2F1G H.014
 	
 %__-?-AB&/C/EF0B CC*+ ,"$% &
 	
  '//2F"GG./ 0,./ 0//
 	
 Hr   c                <    V ^8  d   QhR\         R\         R\         /# )r   storage_folderr   r   r   )r   s   "r   r   r   G   s+     \ \\\ \r   c                    ^ RI p\        P                  P                  T  R24      '       g   \        P                  R4       R# TP                  T  R24      pRTP                  4       9  d   \        P                  R4       R# TR,          pRTP                  4       9  d   \        P                  R4       R# TR,          pT Uu. uF  qwP                  R	4      '       g   K  TNK  	  pp\        T4      ^ 8X  d   \        P                  R
4       Mp\        T^ ,          4      P                  R4      ^,          p	T	R8w  dB   \        P                  ! T	4      \        P                  ! T4      8  d   \        RT RT	 R24      hT Uu. uF  qwP                  R4      '       g   K  TNK  	  p
p\        T
4      ^ 8X  d   \        P                  R4       R# \        T
^ ,          4      P                  R4      ^,          pTR8w  dD   \        P                  ! T4      \        P                  ! T4      8  d   \        RT RT R24      hR# R#   \         d    \        R4      hi ; iu upi u upi )a  
Checks that the `pyproject.toml` file in the directory `storage_folder` has fastai and fastcore versions
that are compatible with `from_pretrained_fastai` and `push_to_hub_fastai`. If `pyproject.toml` does not exist
or does not contain versions for fastai and fastcore, then it logs a warning.

Args:
    storage_folder (`str`):
        Folder to look for the `pyproject.toml` file.
    fastai_min_version (`str`, *optional*):
        The minimum fastai version supported.
    fastcore_min_version (`str`, *optional*):
        The minimum fastcore version supported.

> [!TIP]
> Raises the following errors:
>
>     - [`ImportError`](https://docs.python.org/3/library/exceptions.html#ImportError)
>       if the `toml` module is not installed.
>     - [`ImportError`](https://docs.python.org/3/library/exceptions.html#ImportError)
>       if the `pyproject.toml` indicates a lower than minimum supported version of fastai or fastcore.
Nzn`push_to_hub_fastai` and `from_pretrained_fastai` require the toml module. Install it with `pip install toml`.z/pyproject.tomlzThere is no `pyproject.toml` in the repository that contains the fastai `Learner`. The `pyproject.toml` would allow us to verify that your fastai and fastcore versions are compatible with those of the model you want to load.zbuild-systemzThere is no `build-system` section in the pyproject.toml of the repository that contains the fastai `Learner`. The `build-system` would allow us to verify that your fastai and fastcore versions are compatible with those of the model you want to load.requireszThere is no `requires` section in the pyproject.toml of the repository that contains the fastai `Learner`. The `requires` would allow us to verify that your fastai and fastcore versions are compatible with those of the model you want to load.fastaizPThe repository does not have a fastai version specified in the `pyproject.toml`.= z*`from_pretrained_fastai` requires fastai>=z$ version but the model to load uses z which is incompatible.fastcorezRThe repository does not have a fastcore version specified in the `pyproject.toml`.z,`from_pretrained_fastai` requires fastcore>=r   )tomlModuleNotFoundErrorr   ospathisfileloggerwarningloadkeys
startswithlenr   	partitionr   r    )r%   r   r   r,   pyproject_tomlbuild_system_tomlpackage_versionspckfastai_packagesfastai_versionfastcore_packagesfastcore_versions   &&&         r   )_check_fastai_fastcore_pyproject_versionsr@   G   sM   6
 77>>^,O<==	
 	YY.!1ABN^0022.	
 	&~6*//11.	
 	(4 '7S&6s..:Rss&6OS
?q ij _Q/0::3?BRGOON$CgooVhFi$i./ 0"##:<  )9W(8NN:<V(8W
"kl 034>>sCAFr!goo6F&G'//ZnJo&o23 4,--DF  'p!u  
3
 	

N T Xs#   I I $I I%#I%Iu   ---
tags:
- fastai
---

# Amazing!

🥳 Congratulations on hosting your fastai model on the Hugging Face Hub!

# Some next steps
1. Fill out this model card with more information (see the template below and the [documentation here](https://huggingface.co/docs/hub/model-repos))!

2. Create a demo in Gradio or Streamlit using 🤗 Spaces ([documentation here](https://huggingface.co/docs/hub/spaces)).

3. Join the fastai community on the [Fastai Discord](https://discord.com/invite/YKrxeNn)!

Greetings fellow fastlearner 🤝! Don't forget to delete this content from your model card.


---


# Model card

## Model description
More information needed

## Intended uses & limitations
More information needed

## Training and evaluation data
More information needed
zB[build-system]
requires = ["setuptools>=40.8.0", "wheel", "python=z", "fastai=z", "fastcore=z6"]
build-backend = "setuptools.build_meta:__legacy__"
c                $    V ^8  d   QhR\         /# r   repo_dirr   )r   s   "r   r   r      s     % % %r   c                    V R,          pVP                  4       '       g<   VP                  RRR7      ;_uu_ 4       pVP                  \        4       RRR4       R# R#   + '       g   i     R# ; i)zw
Creates a model card for the repository.

Args:
    repo_dir (`Path`):
        Directory where model card is created.
z	README.mdwutf-8encodingN)existsopenwriteREADME_TEMPLATE)rC   readme_pathfs   &  r   _create_model_cardrO      sX     [(KcG44GGO$ 54  444   AA.	c                $    V ^8  d   QhR\         /# rB   r   )r   s   "r   r   r      s     ( (d (r   c                    V R,          pVP                  4       '       g<   VP                  RRR7      ;_uu_ 4       pVP                  \        4       RRR4       R# R#   + '       g   i     R# ; i)z
Creates a `pyproject.toml` for the repository.

Args:
    repo_dir (`Path`):
        Directory where `pyproject.toml` is created.
zpyproject.tomlrE   rF   rG   N)rI   rJ   rK   PYPROJECT_TEMPLATE)rC   pyproject_pathrN   s   &  r   _create_model_pyprojectrU      sZ      00N  ""  w 771GG&' 87 #777rP   c                v    V ^8  d   QhR\         \        ,          R\        \         \        3,          R,          /# )r   save_directoryconfigN)r   r   dictr   )r   s   "r   r   r      s/     2
 2
$J2
 cNT!2
r   c                   \        4        \        P                  ! VRR7       Ve   \        V\        4      '       g   \        R\        V4       R24      h\        P                  P                  V\        P                  4      p\        VR4      ;_uu_ 4       p\        P                  ! W$4       RRR4       \        \        V4      4       \!        \        V4      4       \        V4      V n        \        P                  ! VRR7        V P#                  R\$        R7       R#   + '       g   i     Lz; i  \&         d    \'        R	4      hi ; i)
a  
Saves a fastai learner to `save_directory` in pickle format using the default pickle protocol for the version of python used.

Args:
    learner (`Learner`):
        The `fastai.Learner` you'd like to save.
    save_directory (`str` or `Path`):
        Specific directory in which you want to save the fastai learner.
    config (`dict`, *optional*):
        Configuration object. Will be uploaded as a .json file. Example: 'https://huggingface.co/espejelomar/fastai-pet-breeds-classification/blob/main/config.json'.

> [!TIP]
> Raises the following error:
>
>     - [`RuntimeError`](https://docs.python.org/3/library/exceptions.html#RuntimeError)
>       if the config file provided is not a dictionary.
T)exist_okNz(Provided config should be a dict. Got: ''rE   	model.pkl)fnamepickle_protocolzYou are using a lambda function, i.e., an anonymous function. `pickle` cannot pickle function objects and requires that all functions have names. One possible solution is to name the function.)r#   r.   makedirs
isinstancerY   RuntimeErrortyper/   joinr	   CONFIG_NAMErJ   jsondumprO   r   rU   exportr   r   )learnerrW   rX   r/   rN   s   &&&  r   _save_pretrained_fastairj      s    , $%KK. &$''!I$v,WXYZZww||NI,A,AB$__IIf   tN+,D01 'GLKK.

, 	 	
 _  
E
 	

s   D D3  D0	3E
c                >    V ^8  d   QhR\         R\         R,          /# )r   repo_idrevisionNr   )r   s   "r   r   r   "  s$     )C )C)CDj)Cr   c                   \        4        \        P                  P                  V 4      '       g   \	        V VR\        4       R7      pMT p\        V4       ^ RIHp V! \        P                  P                  VR4      4      # )a4  
Load pretrained fastai model from the Hub or from a local directory.

Args:
    repo_id (`str`):
        The location where the pickled fastai.Learner is. It can be either of the two:
            - Hosted on the Hugging Face Hub. E.g.: 'espejelomar/fatai-pet-breeds-classification' or 'distilgpt2'.
              You can add a `revision` by appending `@` at the end of `repo_id`. E.g.: `dbmdz/bert-base-german-cased@main`.
              Revision is the specific model version to use. Since we use a git-based system for storing models and other
              artifacts on the Hugging Face Hub, it can be a branch name, a tag name, or a commit id.
            - Hosted locally. `repo_id` would be a directory containing the pickle and a pyproject.toml
              indicating the fastai and fastcore versions used to build the `fastai.Learner`. E.g.: `./my_model_directory/`.
    revision (`str`, *optional*):
        Revision at which the repo's files are downloaded. See documentation of `snapshot_download`.

Returns:
    The `fastai.Learner` model in the `repo_id` repo.
r(   )rl   rm   library_namelibrary_version)load_learnerr]   )
r#   r.   r/   isdirr
   r   r@   fastai.learnerrq   rd   )rl   rm   r%   rq   s   &&  r   from_pretrained_fastairt   !  sd    . $%
 77==!!*!.0	
 !-n=+^[ABBr   commit_messagez(Push FastAI model using huggingface_hub.privatetokenrX   branch	create_prallow_patternsignore_patternsdelete_patternsapi_endpointc                   V ^8  d   QhR\         R\         R\        R,          R\         R,          R\        R,          R\         R,          R\        R,          R	\        \         ,          \         ,          R,          R
\        \         ,          \         ,          R,          R\        \         ,          \         ,          R,          R\         R,          /# )r   rl   ru   rv   Nrw   rX   rx   ry   rz   r{   r|   r}   )r   boolrY   list)r   s   "r   r   r   O  s     O
 O
 O
 	O

 D[O
 :O
 4KO
 $JO
 d{O
 IOd*O
 #Y_t+O
 #Y_t+O
 *O
r   c               >   \        4        \        VR7      pVP                  WVRR7      P                  p\	        4       ;_uu_ 4       p\        V4      V,          p\        WVR7       VP                  VVVVVVVV	V
R7	      uuRRR4       #   + '       g   i     R# ; i)a	  
Upload learner checkpoint files to the Hub.

Use `allow_patterns` and `ignore_patterns` to precisely filter which files should be pushed to the hub. Use
`delete_patterns` to delete existing remote files in the same commit. See [`upload_folder`] reference for more
details.

Args:
    learner (`Learner`):
        The `fastai.Learner' you'd like to push to the Hub.
    repo_id (`str`):
        The repository id for your model in Hub in the format of "namespace/repo_name". The namespace can be your individual account or an organization to which you have write access (for example, 'stanfordnlp/stanza-de').
    commit_message (`str`, *optional*):
        Message to commit while pushing. Will default to :obj:`"add model"`.
    private (`bool`, *optional*):
        Whether or not the repository created should be private.
        If `None` (default), will default to been public except if the organization's default is private.
    token (`str`, *optional*):
        The Hugging Face account token to use as HTTP bearer authorization for remote files. If :obj:`None`, the token will be asked by a prompt.
    config (`dict`, *optional*):
        Configuration object to be saved alongside the model weights.
    branch (`str`, *optional*):
        The git branch on which to push the model. This defaults to
        the default branch as specified in your repository, which
        defaults to `"main"`.
    create_pr (`boolean`, *optional*):
        Whether or not to create a Pull Request from `branch` with that commit.
        Defaults to `False`.
    api_endpoint (`str`, *optional*):
        The API endpoint to use when pushing the model to the hub.
    allow_patterns (`list[str]` or `str`, *optional*):
        If provided, only files matching at least one pattern are pushed.
    ignore_patterns (`list[str]` or `str`, *optional*):
        If provided, files matching any of the patterns are not pushed.
    delete_patterns (`list[str]` or `str`, *optional*):
        If provided, remote files matching any of the patterns will be deleted from the repo.

Returns:
    The url of the commit of your model in the given repository.

> [!TIP]
> Raises the following error:
>
>     - [`ValueError`](https://docs.python.org/3/library/exceptions.html#ValueError)
>       if the user is not log on to the Hugging Face Hub.
)endpointT)rl   rw   rv   r[   )rX   )	rl   rw   folder_pathru   rm   ry   rz   r{   r|   N)r#   r   create_reporl   r   r   rj   upload_folder)ri   rl   ru   rv   rw   rX   rx   ry   rz   r{   r|   r}   apitmp
saved_paths   &$$$$$$$$$$$   r   push_to_hub_fastair   N  s    | $%

&CoogGVZo[ccG 
 	!	!S#Y(
FC  "))++ ! 

 
"	!	!	!s   9BB	)z2.4z1.3.27)N)$rf   r.   pathlibr   pickler   r   typingr   	packagingr   huggingface_hubr	   r
   huggingface_hub.hf_apir   huggingface_hub.utilsr   r   r   r   utilsr   r   
get_logger__name__r1   r#   r@   rL   rS   rO   rU   rj   rt   r    r   r   <module>r      s>    	  2   8 (  1 
		H	%,
^\~ D44F4H3IUgUiTjjw  yM  yO  xP P %(2
j )C )CX O
 E	O

  O
 O
 O
 O
 "O
 .2O
 /3O
 /3O
  $O
 O
r   