DECIMER/config.py
def download_trained_weights(model_url: str, model_path: str, verbose=1):
    """This function downloads the trained models and tokenizers to a default location.
    After downloading the zipped file the function unzips the file automatically.
    If the model exists on the default location this function will not work.
    Args:
        model_url (str): trained model url for downloading.
        model_path (str): model default path to download.
    Returns:
        downloaded model.
    """
    # Download trained models
    if verbose > 0:
        print("Downloading trained model to " + str(model_path))
        model_path = pystow.ensure("DECIMER-V2", url=model_url)
        print(model_path)
    if verbose > 0:
        print("... done downloading trained model!")
        subprocess.run(
            [
                "unzip",
                model_path.as_posix(),
                "-d",
                model_path.parent.as_posix(),
            ]
        )
This function downloads the trained models and tokenizers to a default location.
    After downloading the zipped file the function unzips the file automatically.
    If the model exists on the default location this function will not work.
    Args:
        model_url (str): trained model url for downloading.
        model_path (str): model default path to download.
    Returns:
        downloaded model.
    
This function downloads the trained models and tokenizers to a default location.
After downloading the zipped file the function unzips the file automatically.
If the model exists on the default location this function will not work.
This function downloads the trained models and tokenizers to a default location . After downloading the zipped file the function unzips the file automatically . If the model exists on the default location this function will not work .
def download_trained_weights(model_url: str, model_path: str, verbose=1):
    if verbose > 0:
        print("Downloading trained model to " + str(model_path))
        model_path = pystow.ensure("DECIMER-V2", url=model_url)
        print(model_path)
    if verbose > 0:
        print("... done downloading trained model!")
        subprocess.run(
            [
                "unzip",
                model_path.as_posix(),
                "-d",
                model_path.parent.as_posix(),
            ]
        )
def download_trained_weights ( model_url : str , model_path : str , verbose = 1 ) : if verbose > 0 : print ( "Downloading trained model to " + str ( model_path ) ) model_path = pystow . ensure ( "DECIMER-V2" , url = model_url ) print ( model_path ) if verbose > 0 : print ( "... done downloading trained model!" ) subprocess . run ( [ "unzip" , model_path . as_posix ( ) , "-d" , model_path . parent . as_posix ( ) , ] )
This function downloads the trained models and tokenizers to a default location.
This function downloads the trained models and tokenizers to a default location .
"""This function downloads the trained models and tokenizers to a default location.
    After downloading the zipped file the function unzips the file automatically.
    If the model exists on the default location this function will not work.
    Args:
        model_url (str): trained model url for downloading.
        model_path (str): model default path to download.
    Returns:
        downloaded model.
    """ # Download trained models
None
model_url
str
trained model url for downloading.
trained model url for downloading .
model_path
str
model default path to download.
model default path to download .
verbose