import streamlit as st import os st.title("Install Docling") # Bash script to install Docling bash_script = """ #!/bin/bash # Clone the Docling repository git clone https://github.com/IBM/docling.git # Navigate to the Docling directory cd docling # Install Docling pip install . # Remove the cloned repository (optional) # rm -rf ../docling echo "Docling installed successfully!" """ # Create a temporary bash script file with open("install_docling.sh", "w") as f: f.write(bash_script) # Make the script executable os.chmod("install_docling.sh", 0o755) # Run the bash script if st.button("Install Docling"): with st.spinner("Installing Docling..."): result = os.popen("./install_docling.sh").read() st.code(result, language="bash") # Clean up the script file os.remove("install_docling.sh")