jaothan commited on
Commit
e8c85ec
·
verified ·
1 Parent(s): c17ef77

Update llamacpp_python/base/app.py

Browse files
Files changed (1) hide show
  1. llamacpp_python/base/app.py +15 -7
llamacpp_python/base/app.py CHANGED
@@ -1,13 +1,21 @@
1
- # app.py
2
- import streamlit as st
3
 
4
- # Set the page title
5
- st.set_page_config(page_title="Hello World App")
 
6
 
7
- # Display a title
8
- st.title("Hello, World!")
 
 
 
 
 
9
 
10
- # Display a message
 
 
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)