How to use the mindsdb.libs.data_types.mindsdb_logger.log.warning function in MindsDB

To help you get started, we’ve selected a few MindsDB examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github mindsdb / mindsdb / mindsdb / libs / data_entities / persistent_ml_model_info.py View on Github external
if self.fs_file_ids is None:
            return

        files = self.fs_file_ids
        if type(files) != type([]):
            files = [files]
        for file in files:
            filename = '{path}/{filename}.pt'.format(path=MINDSDB_STORAGE_PATH, filename=file)
            try:


                file_path = Path(filename)
                if file_path.is_file():
                    os.remove(filename)
                else:
                    log.warning('could not delete file {file} becasue it doesnt exist'.format(file=filename))

            except OSError:
                log.error('could not delete file {file}'.format(file=filename))
github mindsdb / mindsdb / mindsdb / libs / helpers / general_helpers.py View on Github external
r = requests.get('http://mindsdb.com/updates/check/{extra}'.format(extra=extra), headers={'referer': 'http://check.mindsdb.com/?token={token}'.format(token=token)})
    except:
        log.warning('Could not check for updates')
        return
    try:
        # TODO: Extract version, compare with version in version.py
        ret = r.json()

        if 'version' in ret and ret['version']!= __version__:
            pass
            #log.warning("There is a new version of MindsDB {version}, please do:\n    pip3 uninstall mindsdb\n    pip3 install mindsdb --user".format(version=ret['version']))
        else:
            log.debug('MindsDB is up to date!')

    except:
        log.warning('could not check for MindsDB updates')
github mindsdb / mindsdb / mindsdb / libs / ml_models / pytorch / libs / base_model.py View on Github external
def setLearningRateIndex(self, index):
        """
        This updates the pointers in the learning rates
        :param index: the index
        :return:
        """
        if index >= len(self.learning_rates):
            index = len(self.learning_rates) -1
            log.warning('Trying to set the learning rate on an index greater than learnign rates available')

        self.current_learning_rate_index = index
        self.total_epochs = self.learning_rates[self.current_learning_rate_index][EPOCHS_INDEX]
        self.current_learning_rate = self.learning_rates[self.current_learning_rate_index][LEARNING_RATE_INDEX]
github mindsdb / mindsdb / mindsdb / libs / helpers / general_helpers.py View on Github external
r = requests.get('http://mindsdb.com/updates/check/{extra}'.format(extra=extra), headers={'referer': 'http://check.mindsdb.com/?token={token}'.format(token=token)})
    except:
        log.warning('Could not check for updates')
        return
    try:
        # TODO: Extract version, compare with version in version.py
        ret = r.json()

        if 'version' in ret and ret['version']!= __version__:
            pass
            #log.warning("There is a new version of MindsDB {version}, please do:\n    pip3 uninstall mindsdb\n    pip3 install mindsdb --user".format(version=ret['version']))
        else:
            log.debug('MindsDB is up to date!')

    except:
        log.warning('could not check for MindsDB updates')
github mindsdb / mindsdb / mindsdb / libs / ml_models / pytorch / libs / base_model.py View on Github external
def setLearningRateIndex(self, index):
        """
        This updates the pointers in the learning rates
        :param index: the index
        :return:
        """
        if index >= len(self.learning_rates):
            index = len(self.learning_rates) -1
            log.warning('Trying to set the learning rate on an index greater than learnign rates available')

        self.current_learning_rate_index = index
        self.total_epochs = self.learning_rates[self.current_learning_rate_index][EPOCHS_INDEX]
        self.current_learning_rate = self.learning_rates[self.current_learning_rate_index][LEARNING_RATE_INDEX]
github mindsdb / mindsdb / mindsdb / libs / helpers / general_helpers.py View on Github external
file_path = Path(mdb_file)
    if file_path.is_file():
        token = open(mdb_file).read()
    else:
        token = '{system}|{version}|{uid}'.format(system=platform.system(), version=__version__, uid=uuid_str)
        try:
            open(mdb_file,'w').write(token)
        except:
            log.warning('Cannot store token, Please add write permissions to file:'+mdb_file)
            token = token+'.NO_WRITE'
    extra = urllib.parse.quote_plus(token)
    try:
        r = requests.get('http://mindsdb.com/updates/check/{extra}'.format(extra=extra), headers={'referer': 'http://check.mindsdb.com/?token={token}'.format(token=token)})
    except:
        log.warning('Could not check for updates')
        return
    try:
        # TODO: Extract version, compare with version in version.py
        ret = r.json()

        if 'version' in ret and ret['version']!= __version__:
            pass
            #log.warning("There is a new version of MindsDB {version}, please do:\n    pip3 uninstall mindsdb\n    pip3 install mindsdb --user".format(version=ret['version']))
        else:
            log.debug('MindsDB is up to date!')

    except:
        log.warning('could not check for MindsDB updates')
github mindsdb / mindsdb / mindsdb / libs / helpers / general_helpers.py View on Github external
file_path = Path(mdb_file)
    if file_path.is_file():
        token = open(mdb_file).read()
    else:
        token = '{system}|{version}|{uid}'.format(system=platform.system(), version=__version__, uid=uuid_str)
        try:
            open(mdb_file,'w').write(token)
        except:
            log.warning('Cannot store token, Please add write permissions to file:'+mdb_file)
            token = token+'.NO_WRITE'
    extra = urllib.parse.quote_plus(token)
    try:
        r = requests.get('http://mindsdb.com/updates/check/{extra}'.format(extra=extra), headers={'referer': 'http://check.mindsdb.com/?token={token}'.format(token=token)})
    except:
        log.warning('Could not check for updates')
        return
    try:
        # TODO: Extract version, compare with version in version.py
        ret = r.json()

        if 'version' in ret and ret['version']!= __version__:
            pass
            #log.warning("There is a new version of MindsDB {version}, please do:\n    pip3 uninstall mindsdb\n    pip3 install mindsdb --user".format(version=ret['version']))
        else:
            log.debug('MindsDB is up to date!')

    except:
        log.warning('could not check for MindsDB updates')