imseldrith's picture
Upload folder using huggingface_hub (#1)
21dcd64
raw
history blame
732 Bytes
from typing import Optional
import gradio
import DeepFakeAI.globals
import DeepFakeAI.choices
from DeepFakeAI import wording
MAX_MEMORY_SLIDER : Optional[gradio.Slider] = None
def render() -> None:
global MAX_MEMORY_SLIDER
MAX_MEMORY_SLIDER = gradio.Slider(
label = wording.get('max_memory_slider_label'),
step = DeepFakeAI.choices.max_memory_range[1] - DeepFakeAI.choices.max_memory_range[0],
minimum = DeepFakeAI.choices.max_memory_range[0],
maximum = DeepFakeAI.choices.max_memory_range[-1]
)
def listen() -> None:
MAX_MEMORY_SLIDER.change(update_max_memory, inputs = MAX_MEMORY_SLIDER)
def update_max_memory(max_memory : int) -> None:
DeepFakeAI.globals.max_memory = max_memory if max_memory > 0 else None