Spaces:
Sleeping
Sleeping
Upload folder using huggingface_hub
Browse files- app.py +69 -0
- requirements.txt +1 -0
app.py
ADDED
|
@@ -0,0 +1,69 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import streamlit as st
|
| 2 |
+
|
| 3 |
+
# Configure the page
|
| 4 |
+
st.set_page_config(
|
| 5 |
+
page_title="My Streamlit App",
|
| 6 |
+
page_icon="π",
|
| 7 |
+
layout="wide"
|
| 8 |
+
)
|
| 9 |
+
|
| 10 |
+
# Sidebar for API Key input
|
| 11 |
+
with st.sidebar:
|
| 12 |
+
st.header("βοΈ Configuration")
|
| 13 |
+
api_key = st.text_input(
|
| 14 |
+
"Enter API Key",
|
| 15 |
+
type="password",
|
| 16 |
+
placeholder="Enter your API key here",
|
| 17 |
+
help="Your API key will be kept secure"
|
| 18 |
+
)
|
| 19 |
+
|
| 20 |
+
if api_key:
|
| 21 |
+
st.success("β API Key entered")
|
| 22 |
+
else:
|
| 23 |
+
st.warning("β οΈ Please enter your API Key")
|
| 24 |
+
|
| 25 |
+
st.divider()
|
| 26 |
+
st.markdown("### About")
|
| 27 |
+
st.info("This is a Streamlit application with API key authentication.")
|
| 28 |
+
|
| 29 |
+
# Main content area
|
| 30 |
+
st.title("π Welcome to My Streamlit App")
|
| 31 |
+
st.markdown("---")
|
| 32 |
+
|
| 33 |
+
# Check if API key is provided
|
| 34 |
+
if api_key:
|
| 35 |
+
st.success("π You're authenticated! The app is ready to use.")
|
| 36 |
+
|
| 37 |
+
# Add your main app content here
|
| 38 |
+
st.header("Main Application")
|
| 39 |
+
|
| 40 |
+
col1, col2 = st.columns(2)
|
| 41 |
+
|
| 42 |
+
with col1:
|
| 43 |
+
st.subheader("π Section 1")
|
| 44 |
+
st.write("Add your content here")
|
| 45 |
+
user_input = st.text_input("Enter some text:")
|
| 46 |
+
if user_input:
|
| 47 |
+
st.write(f"You entered: {user_input}")
|
| 48 |
+
|
| 49 |
+
with col2:
|
| 50 |
+
st.subheader("π Section 2")
|
| 51 |
+
st.write("Add more content here")
|
| 52 |
+
option = st.selectbox(
|
| 53 |
+
"Choose an option:",
|
| 54 |
+
["Option 1", "Option 2", "Option 3"]
|
| 55 |
+
)
|
| 56 |
+
st.write(f"You selected: {option}")
|
| 57 |
+
|
| 58 |
+
# Example button
|
| 59 |
+
if st.button("Click Me!"):
|
| 60 |
+
st.balloons()
|
| 61 |
+
st.success("Button clicked!")
|
| 62 |
+
|
| 63 |
+
else:
|
| 64 |
+
st.warning("β οΈ Please enter your API Key in the sidebar to continue.")
|
| 65 |
+
st.info("π Use the sidebar on the left to enter your API key.")
|
| 66 |
+
|
| 67 |
+
# Footer
|
| 68 |
+
st.markdown("---")
|
| 69 |
+
st.markdown("Built with Streamlit π")
|
requirements.txt
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
streamlit>=1.34.0
|