Spaces:
Build error
Build error
Compute disk usage
Browse files123453 unmodified lines910111213141550 unmodified lines66676869707172737475767778798081import base64import json5import timeimport streamlit as stimport streamlit.runtime.scriptrunner as st_sr3 unmodified linesimport pptx_helperfrom global_config import GlobalConfigAPP_TEXT = json5.loads(open(GlobalConfig.APP_STRINGS_FILE, 'r').read())@st.cache_data50 unmodified linesreturn llm_helper.get_ai_image(text)def build_ui():"""Display the input elements for content generation. Only covers the first step."""st.title(APP_TEXT['app_name'])st.subheader(APP_TEXT['caption'])st.markdown('')st.divider()st.header(APP_TEXT['section_headers'][0])12345673 unmodified lines11121314151617181950 unmodified lines707172737475767778798081828384858687888990919293949596979899100101102103104105106107108import base64import osimport json5import shutilimport timeimport streamlit as stimport streamlit.runtime.scriptrunner as st_sr3 unmodified linesimport pptx_helperfrom global_config import GlobalConfigAPP_TEXT = json5.loads(open(GlobalConfig.APP_STRINGS_FILE, 'r').read())GB_CONVERTER = 2 ** 30@st.cache_data50 unmodified linesreturn 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_CONVERTERused = used // GB_CONVERTERfree = free // GB_CONVERTERused_perc = 100.0 * used / totalprint(f'Total: {total} GB\n'f'Used: {used} GB\n'f'Free: {free} GB')print('\n'.join(os.listdir()))return used_percdef 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.divider()st.header(APP_TEXT['section_headers'][0])
app.py+30-3