Qa/follow set naming (#867)
* Follow set naming * Follow set naming * Disable type hints * Uniform order
This commit is contained in:
@@ -4,7 +4,7 @@ import pytest
|
||||
from onnxruntime import InferenceSession
|
||||
|
||||
from facefusion import content_analyser, state_manager
|
||||
from facefusion.inference_manager import INFERENCE_POOLS, get_inference_pool
|
||||
from facefusion.inference_manager import INFERENCE_POOL_SET, get_inference_pool
|
||||
|
||||
|
||||
@pytest.fixture(scope = 'module', autouse = True)
|
||||
@@ -17,16 +17,16 @@ def before_all() -> None:
|
||||
|
||||
def test_get_inference_pool() -> None:
|
||||
model_names = [ 'yolo_nsfw' ]
|
||||
model_sources = content_analyser.get_model_options().get('sources')
|
||||
model_source_set = content_analyser.get_model_options().get('sources')
|
||||
|
||||
with patch('facefusion.inference_manager.detect_app_context', return_value = 'cli'):
|
||||
get_inference_pool('facefusion.content_analyser', model_names, model_sources)
|
||||
get_inference_pool('facefusion.content_analyser', model_names, model_source_set)
|
||||
|
||||
assert isinstance(INFERENCE_POOLS.get('cli').get('facefusion.content_analyser.yolo_nsfw.0.cpu').get('content_analyser'), InferenceSession)
|
||||
assert isinstance(INFERENCE_POOL_SET.get('cli').get('facefusion.content_analyser.yolo_nsfw.0.cpu').get('content_analyser'), InferenceSession)
|
||||
|
||||
with patch('facefusion.inference_manager.detect_app_context', return_value = 'ui'):
|
||||
get_inference_pool('facefusion.content_analyser', model_names, model_sources)
|
||||
get_inference_pool('facefusion.content_analyser', model_names, model_source_set)
|
||||
|
||||
assert isinstance(INFERENCE_POOLS.get('ui').get('facefusion.content_analyser.yolo_nsfw.0.cpu').get('content_analyser'), InferenceSession)
|
||||
assert isinstance(INFERENCE_POOL_SET.get('ui').get('facefusion.content_analyser.yolo_nsfw.0.cpu').get('content_analyser'), InferenceSession)
|
||||
|
||||
assert INFERENCE_POOLS.get('cli').get('facefusion.content_analyser.yolo_nsfw.0.cpu').get('content_analyser') == INFERENCE_POOLS.get('ui').get('facefusion.content_analyser.yolo_nsfw.0.cpu').get('content_analyser')
|
||||
assert INFERENCE_POOL_SET.get('cli').get('facefusion.content_analyser.yolo_nsfw.0.cpu').get('content_analyser') == INFERENCE_POOL_SET.get('ui').get('facefusion.content_analyser.yolo_nsfw.0.cpu').get('content_analyser')
|
||||
|
||||
Reference in New Issue
Block a user