#!/usr/bin/env python # coding: utf-8 # In[ ]: ##~ WIDGET CODE | BY: ANXETY ~## import os import sys 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 detect_environment(): environments = { 'COLAB_GPU': ('Google Colab', "/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 sys.exit("\033[31mError: an unsupported runtime environment was detected.\n\033[34mSupported environments:\033[0m Google Colab, Kaggle, Sagemaker Studio Lab") env, root_path = detect_environment() webui_path = f"{root_path}/sdw" get_ipython().system('mkdir -p {root_path}') # ---------------------------------------------- # ==================== CSS JS ==================== # --- CSS --- CSS = ''' ''' display(HTML(CSS)) # ==================== CSS JS ==================== # ==================== WIDGETS ==================== # --- global widgets --- style = {'description_width': 'initial'} layout = widgets.Layout(min_width='1047px') HR = widgets.HTML('