Commit ·
edf8619
1
Parent(s): 977dc2e
Add tmp cleaning code
Browse files245 unmodified lines246247248249250251245 unmodified lines)# Launch the Gradio appif __name__ == "__main__":pipeline = TrellisImageTo3DPipeline.from_pretrained("JeffreyXiang/TRELLIS-image-large")245 unmodified lines246247248249250251252253254255256257258259260261262263264265266267268245 unmodified lines)# Cleans up the temporary directory every 10 minutesimport threadingimport timedef cleanup_tmp_dir():while True:if os.path.exists(TMP_DIR):for file in os.listdir(TMP_DIR):# remove files older than 10 minutesif time.time() - os.path.getmtime(os.path.join(TMP_DIR, file)) > 600:os.remove(os.path.join(TMP_DIR, file))time.sleep(600)cleanup_thread = threading.Thread(target=cleanup_tmp_dir)cleanup_thread.start()# Launch the Gradio appif __name__ == "__main__":pipeline = TrellisImageTo3DPipeline.from_pretrained("JeffreyXiang/TRELLIS-image-large")
app.py+17