Spaces:
Build error
Build error
Update llamacpp_python/base/app.py
Browse files- llamacpp_python/base/app.py +15 -7
llamacpp_python/base/app.py
CHANGED
|
@@ -1,13 +1,21 @@
|
|
| 1 |
-
|
| 2 |
-
import
|
| 3 |
|
| 4 |
-
#
|
| 5 |
-
|
|
|
|
| 6 |
|
| 7 |
-
#
|
| 8 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 9 |
|
| 10 |
-
#
|
|
|
|
|
|
|
| 11 |
st.write("This is a Streamlit app that says 'Hello, World!'.")
|
| 12 |
|
| 13 |
# Add some interactivity (optional)
|
|
|
|
| 1 |
+
import subprocess
|
| 2 |
+
import sys
|
| 3 |
|
| 4 |
+
# Function to install a package using pip
|
| 5 |
+
def install(package):
|
| 6 |
+
subprocess.check_call([sys.executable, "-m", "pip", "install", package])
|
| 7 |
|
| 8 |
+
# Install Streamlit if it's not already installed
|
| 9 |
+
try:
|
| 10 |
+
import streamlit as st
|
| 11 |
+
except ImportError:
|
| 12 |
+
print("Streamlit is not installed. Installing now...")
|
| 13 |
+
install("streamlit")
|
| 14 |
+
import streamlit as st
|
| 15 |
|
| 16 |
+
# Streamlit app code
|
| 17 |
+
st.set_page_config(page_title="Hello World App")
|
| 18 |
+
st.title("Hello, World!")
|
| 19 |
st.write("This is a Streamlit app that says 'Hello, World!'.")
|
| 20 |
|
| 21 |
# Add some interactivity (optional)
|