##~ WIDGET CODE | BY: ANXETY ~## import os import json import ipywidgets as widgets from ipywidgets import widgets, Layout, Label, Button, VBox, HBox from IPython.display import display, HTML, Javascript, clear_output # ================= DETECT ENV ================= def check_colab_subscription(): return (os.sysconf('SC_PAGE_SIZE') * os.sysconf('SC_PHYS_PAGES') / (1024. ** 3) <= 20) free_plan = check_colab_subscription() def detect_environment(): environments = { 'COLAB_GPU': ('Google Colab', "/root" if free_plan else "/content"), 'KAGGLE_URL_BASE': ('Kaggle', "/kaggle/working/content"), 'SAGEMAKER_INTERNAL_IMAGE_URI': ('SageMaker Studio Lab', "/home/studio-lab-user/content") } for env_var, (environment, path) in environments.items(): if env_var in os.environ: return environment, path env, root_path = detect_environment() webui_path = f"{root_path}/sdw" get_ipython().system('mkdir -p {root_path}') # ---------------------------------------------- # ==================== CSS JS ==================== CSS = ''' ''' display(HTML(CSS)) # ==================== CSS JS ==================== # ==================== WIDGETS ==================== # --- global widgets --- style = {'description_width': 'initial'} layout = widgets.Layout(min_width='1047px') HR = widgets.HTML('