Spaces:
Sleeping
Sleeping
File size: 834 Bytes
6c6df07 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 |
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") |