mirror of
https://github.com/facefusion/facefusion.git
synced 2026-04-23 01:46:09 +02:00
a498f3d618
* remove insecure flag from curl * eleminate repating definitons * limit processors and ui layouts by choices * follow couple of v4 standards * use more secure mkstemp * dynamic cache path for execution providers * fix benchmarker, prevent path traveling via job-id * fix order in execution provider choices * resort by prioroty * introduce support for QNN * close file description for Windows to stop crying * prevent ConnectionResetError under windows * needed for nested .caches directory as onnxruntime does not create it * different approach to silent asyncio * update dependencies * simplify the name to just inference providers * switch to trt_builder_optimization_level 4
33 lines
840 B
Python
33 lines
840 B
Python
import itertools
|
|
import shutil
|
|
from typing import List
|
|
|
|
from facefusion import metadata
|
|
from facefusion.types import Command
|
|
|
|
|
|
def run(commands : List[Command]) -> List[Command]:
|
|
user_agent = metadata.get('name') + '/' + metadata.get('version')
|
|
|
|
return [ shutil.which('curl'), '--user-agent', user_agent, '--location', '--silent' ] + commands
|
|
|
|
|
|
def chain(*commands : List[Command]) -> List[Command]:
|
|
return list(itertools.chain(*commands))
|
|
|
|
|
|
def ping(url : str) -> List[Command]:
|
|
return [ '-I', url ]
|
|
|
|
|
|
def download(url : str, download_file_path : str) -> List[Command]:
|
|
return [ '--create-dirs', '--continue-at', '-', '--output', download_file_path, url ]
|
|
|
|
|
|
def set_timeout(timeout : int) -> List[Command]:
|
|
return [ '--connect-timeout', str(timeout) ]
|
|
|
|
|
|
def set_retry(retry : int) -> List[Command]:
|
|
return [ '--retry', str(retry) ]
|