def __init__(self,
                 options_file: str = DEFAULT_OPTIONS_FILE,
                 weight_file: str = DEFAULT_WEIGHT_FILE,
                 cuda_device: int = -1) -> None:
        """
        Parameters
        ----------
        options_file : ``str``, optional
            A path or URL to an ELMo options file.
        weight_file : ``str``, optional
            A path or URL to an ELMo weights file.
        cuda_device : ``int``, optional, (default=-1)
            The GPU device to run on.
        """
        self.indexer = ELMoTokenCharactersIndexer()

        logger.info("Initializing ELMo.")
        self.elmo_bilm = _ElmoBiLm(options_file, weight_file)
        if cuda_device >= 0:
            self.elmo_bilm = self.elmo_bilm.cuda(device=cuda_device)

        self.cuda_device = cuda_device
def __init__ ( self , options_file : str = DEFAULT_OPTIONS_FILE , weight_file : str = DEFAULT_WEIGHT_FILE , cuda_device : int = - 1 ) -> None : self . indexer = ELMoTokenCharactersIndexer ( ) logger . info ( "Initializing ELMo." ) self . elmo_bilm = _ElmoBiLm ( options_file , weight_file ) if cuda_device >= 0 : self . elmo_bilm = self . elmo_bilm . cuda ( device = cuda_device ) self . cuda_device = cuda_device
Parameters
        ----------
        options_file : ``str``, optional
            A path or URL to an ELMo options file.
        weight_file : ``str``, optional
            A path or URL to an ELMo weights file.
        cuda_device : ``int``, optional, (default=-1)
            The GPU device to run on.