Spaces:
Running
Running
File size: 942 Bytes
3e6066c |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 |
from typing import Optional
import gradio
import DeepFakeAI.globals
import DeepFakeAI.choices
from DeepFakeAI import wording
EXECUTION_THREAD_COUNT_SLIDER : Optional[gradio.Slider] = None
def render() -> None:
global EXECUTION_THREAD_COUNT_SLIDER
EXECUTION_THREAD_COUNT_SLIDER = gradio.Slider(
label = wording.get('execution_thread_count_slider_label'),
value = DeepFakeAI.globals.execution_thread_count,
step = DeepFakeAI.choices.execution_thread_count_range[1] - DeepFakeAI.choices.execution_thread_count_range[0],
minimum = DeepFakeAI.choices.execution_thread_count_range[0],
maximum = DeepFakeAI.choices.execution_thread_count_range[-1]
)
def listen() -> None:
EXECUTION_THREAD_COUNT_SLIDER.change(update_execution_thread_count, inputs = EXECUTION_THREAD_COUNT_SLIDER)
def update_execution_thread_count(execution_thread_count : int = 1) -> None:
DeepFakeAI.globals.execution_thread_count = execution_thread_count
|