Upload 2 files
Browse files- main.py +38 -0
- requirements.txt +9 -0
main.py
ADDED
@@ -0,0 +1,38 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import streamlit as st
|
2 |
+
import importlib.util
|
3 |
+
import os
|
4 |
+
|
5 |
+
st.set_page_config(
|
6 |
+
page_title="Tveir",
|
7 |
+
page_icon=":fog:",
|
8 |
+
)
|
9 |
+
|
10 |
+
st.sidebar.markdown('Main Page :balloon:')
|
11 |
+
st.title(':blue[Tveir]')
|
12 |
+
st.write('This is the index page.')
|
13 |
+
st.markdown('this is essentially a one-size-fits-all project.')
|
14 |
+
|
15 |
+
# Dictionary to map page names to file paths
|
16 |
+
pages = {
|
17 |
+
"Home": None,
|
18 |
+
# "Page A": "pages/1_a.py",
|
19 |
+
"Hotdog Page": "pages/2_hotdog.py",
|
20 |
+
"HuggingFace Tutorial": "pages/3_hf_tutorial.py",
|
21 |
+
"All place": "pages/4_all.py",
|
22 |
+
"Uber from Documentation": "pages/5_Uber_from_doc.py"
|
23 |
+
}
|
24 |
+
|
25 |
+
|
26 |
+
# Selectbox for navigation
|
27 |
+
selected_page = st.sidebar.selectbox("Select a page", list(pages.keys()))
|
28 |
+
|
29 |
+
# Function to load and execute a page script
|
30 |
+
def load_page(page_path):
|
31 |
+
if page_path is not None and os.path.exists(page_path):
|
32 |
+
spec = importlib.util.spec_from_file_location("page_module", page_path)
|
33 |
+
page_module = importlib.util.module_from_spec(spec)
|
34 |
+
spec.loader.exec_module(page_module)
|
35 |
+
|
36 |
+
# Display the selected page
|
37 |
+
if selected_page in pages:
|
38 |
+
load_page(pages[selected_page])
|
requirements.txt
ADDED
@@ -0,0 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
openai
|
2 |
+
pandas
|
3 |
+
numpy
|
4 |
+
streamlit
|
5 |
+
langchain
|
6 |
+
langchain-community
|
7 |
+
langchain_google_genai
|
8 |
+
transformers
|
9 |
+
torch
|