Unpin picklescan req and cleanup

This commit is contained in:
blessedcoolant 2022-11-17 11:56:54 +13:00 committed by Lincoln Stein
parent 2d6e0baa87
commit ac8a7ff70b
3 changed files with 7 additions and 7 deletions

View File

@ -30,7 +30,7 @@ test-tube>=0.7.5
torch-fidelity torch-fidelity
torchmetrics torchmetrics
transformers==4.21.* transformers==4.21.*
picklescan==0.0.5 picklescan
git+https://github.com/openai/CLIP.git@main#egg=clip git+https://github.com/openai/CLIP.git@main#egg=clip
git+https://github.com/Birch-san/k-diffusion.git@mps#egg=k-diffusion git+https://github.com/Birch-san/k-diffusion.git@mps#egg=k-diffusion
git+https://github.com/invoke-ai/clipseg.git@relaxed-python-requirement#egg=clipseg git+https://github.com/invoke-ai/clipseg.git@relaxed-python-requirement#egg=clipseg

View File

@ -19,7 +19,7 @@ torch-fidelity
torchvision==0.13.1 ; platform_system == 'Darwin' torchvision==0.13.1 ; platform_system == 'Darwin'
torchvision==0.13.1+cu116 ; platform_system == 'Linux' or platform_system == 'Windows' torchvision==0.13.1+cu116 ; platform_system == 'Linux' or platform_system == 'Windows'
transformers transformers
picklescan==0.0.5 picklescan
https://github.com/openai/CLIP/archive/d50d76daa670286dd6cacf3bcd80b5e4823fc8e1.zip https://github.com/openai/CLIP/archive/d50d76daa670286dd6cacf3bcd80b5e4823fc8e1.zip
https://github.com/TencentARC/GFPGAN/archive/2eac2033893ca7f427f4035d80fe95b92649ac56.zip https://github.com/TencentARC/GFPGAN/archive/2eac2033893ca7f427f4035d80fe95b92649ac56.zip
https://github.com/invoke-ai/k-diffusion/archive/7f16b2c33411f26b3eae78d10648d625cb0c1095.zip https://github.com/invoke-ai/k-diffusion/archive/7f16b2c33411f26b3eae78d10648d625cb0c1095.zip

View File

@ -12,13 +12,15 @@ import time
import gc import gc
import hashlib import hashlib
import psutil import psutil
import sys
import transformers import transformers
import traceback import traceback
import os import os
from sys import getrefcount
from omegaconf import OmegaConf from omegaconf import OmegaConf
from omegaconf.errors import ConfigAttributeError from omegaconf.errors import ConfigAttributeError
from ldm.util import instantiate_from_config from ldm.util import instantiate_from_config
from picklescan.scanner import scan_file_path
DEFAULT_MAX_MODELS=2 DEFAULT_MAX_MODELS=2
@ -201,7 +203,7 @@ class ModelCache(object):
height = mconfig.height height = mconfig.height
# scan model # scan model
self.scan_model(model_name, weights) self._scan_model(model_name, weights)
print(f'>> Loading {model_name} from {weights}') print(f'>> Loading {model_name} from {weights}')
@ -279,10 +281,8 @@ class ModelCache(object):
if self._has_cuda(): if self._has_cuda():
torch.cuda.empty_cache() torch.cuda.empty_cache()
def scan_model(self, model_name, checkpoint): def _scan_model(self, model_name, checkpoint):
# scan model # scan model
from picklescan.scanner import scan_file_path
import sys
print(f'>> Scanning Model: {model_name}') print(f'>> Scanning Model: {model_name}')
scan_result = scan_file_path(checkpoint) scan_result = scan_file_path(checkpoint)
if scan_result.infected_files != 0: if scan_result.infected_files != 0: