Spaces:
Build error
Build error
Compute disk usage
Browse files12345673 unmodified lines11121314151617181950 unmodified lines707172737475767778798081828384858687888990919293949596979899100101102767778103104105106107108import base64import osimport json5import shutilimport timeimport streamlit as stimport streamlit.runtime.scriptrunner as st_sr3 unmodified linesimport pptx_helperfrom global_config import GlobalConfig
APP_TEXT = json5.loads(open(GlobalConfig.APP_STRINGS_FILE, 'r').read())GB_CONVERTER = 2 ** 30
@st.cache_data50 unmodified lines return llm_helper.get_ai_image(text)
def get_disk_used_percentage() -> float: """ Compute the disk usage.
:return: Percentage of the disk space currently used """
total, used, free = shutil.disk_usage('/') total = total // GB_CONVERTER used = used // GB_CONVERTER free = free // GB_CONVERTER used_perc = 100.0 * used / total print(f'Total: {total} GB\n' f'Used: {used} GB\n' f'Free: {free} GB')
print('\n'.join(os.listdir()))
return used_perc
def build_ui(): """ Display the input elements for content generation. Only covers the first step. """
get_disk_used_percentage()
st.title(APP_TEXT['app_name']) st.subheader(APP_TEXT['caption']) st.markdown( '' ) # st.markdown( # '' # ) st.divider()
st.header(APP_TEXT['section_headers'][0])app.py+30-3