<commit_before>import os

import numpy as np
from django.conf import settings

from cnntools.utils import add_caffe_to_path


def load_fet_extractor(
    deployfile_relpath,
    weights_relpath,
    do_preprocessing=True,
    image_dims=(256, 256),
    mean=(104, 117, 123),
    device_id=0,
    input_scale=1,
):
    add_caffe_to_path()
    import caffe

    FeatureExtractor = def_FeatureExtractor(caffe)

    if mean is not None:
        mean = np.array(mean)<commit_msg>Silence Caffe<commit_after>import os

import numpy as np
from django.conf import settings

from cnntools.utils import add_caffe_to_path


def load_fet_extractor(
    deployfile_relpath,
    weights_relpath,
    do_preprocessing=True,
    image_dims=(256, 256),
    mean=(104, 117, 123),
    device_id=0,
    input_scale=1,
):
    # Silence Caffe
    from os import environ
    environ['GLOG_minloglevel'] = '2'

    add_caffe_to_path()
    import caffe

    FeatureExtractor = def_FeatureExtractor(caffe)

    if mean is not None:
        mean = np.array(mean)
{'fraction_non_alphanumeric': 0.07930367504835589, 'fraction_numerical': 0.033849129593810444, 'mean_word_length': 3.5594713656387666, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5583678', 'n_tokens_mistral': 391, 'n_tokens_neox': 354, 'n_words': 84}