Spaces:
Running
Running
File size: 732 Bytes
21dcd64 |
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 |
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
|