Spaces:
Sleeping
Sleeping
Zach Holcomb
commited on
Commit
·
f4d4bb8
0
Parent(s):
Initial commit
Browse files- __pycache__/functions.cpython-310.pyc +0 -0
- app.py +47 -0
- functions.py +2 -0
- requirements.txt +70 -0
__pycache__/functions.cpython-310.pyc
ADDED
|
Binary file (265 Bytes). View file
|
|
|
app.py
ADDED
|
@@ -0,0 +1,47 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import streamlit as st
|
| 2 |
+
import pandas as pd
|
| 3 |
+
from functions import *
|
| 4 |
+
|
| 5 |
+
tab1, tab2 = st.tabs(['Model', 'Data Selection'])
|
| 6 |
+
|
| 7 |
+
with tab2:
|
| 8 |
+
dataframes = []
|
| 9 |
+
data_names = []
|
| 10 |
+
uploaded_data = st.file_uploader('Upload your data', accept_multiple_files=True)
|
| 11 |
+
|
| 12 |
+
for file in uploaded_data:
|
| 13 |
+
if file and file is not None:
|
| 14 |
+
file_type = file.name.split('.')[-1].lower()
|
| 15 |
+
|
| 16 |
+
if file_type == 'csv':
|
| 17 |
+
dataframes.append(pd.read_csv(file))
|
| 18 |
+
data_names.append(file.name)
|
| 19 |
+
elif file_type == 'parquet':
|
| 20 |
+
dataframes.append(pd.read_parquet(file))
|
| 21 |
+
data_names.append(file.name)
|
| 22 |
+
elif file_type in ['xls', 'xlsx']:
|
| 23 |
+
dataframes.append(pd.read_excel(file))
|
| 24 |
+
data_names.append(file.name)
|
| 25 |
+
else:
|
| 26 |
+
st.error("Unsupported file format. Please upload a CSV, Parquet, or Excel file.")
|
| 27 |
+
|
| 28 |
+
selected_data = st.selectbox(
|
| 29 |
+
'Select data:',
|
| 30 |
+
(data_names)
|
| 31 |
+
)
|
| 32 |
+
|
| 33 |
+
if selected_data:
|
| 34 |
+
index = data_names.index(selected_data)
|
| 35 |
+
df = dataframes[index]
|
| 36 |
+
|
| 37 |
+
st.dataframe(df)
|
| 38 |
+
|
| 39 |
+
|
| 40 |
+
|
| 41 |
+
with tab1:
|
| 42 |
+
user_query = st.text_input('Ask any question about the data')
|
| 43 |
+
|
| 44 |
+
if not uploaded_data:
|
| 45 |
+
st.error('Please upload data in Data Selection')
|
| 46 |
+
elif user_query:
|
| 47 |
+
st.write(query_model(user_query))
|
functions.py
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
|
|
|
|
|
|
|
| 1 |
+
def query_model(query):
|
| 2 |
+
return 'Hmmmm. Good question. The answer is probably 42.'
|
requirements.txt
ADDED
|
@@ -0,0 +1,70 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
absl-py==2.1.0
|
| 2 |
+
altair==5.5.0
|
| 3 |
+
astunparse==1.6.3
|
| 4 |
+
attrs==25.1.0
|
| 5 |
+
beautifulsoup4==4.13.3
|
| 6 |
+
blinker==1.9.0
|
| 7 |
+
bs4==0.0.2
|
| 8 |
+
cachetools==5.5.2
|
| 9 |
+
certifi==2025.1.31
|
| 10 |
+
charset-normalizer==3.4.1
|
| 11 |
+
click==8.1.8
|
| 12 |
+
filelock==3.17.0
|
| 13 |
+
flatbuffers==25.2.10
|
| 14 |
+
fsspec==2025.2.0
|
| 15 |
+
gast==0.6.0
|
| 16 |
+
gitdb==4.0.12
|
| 17 |
+
GitPython==3.1.44
|
| 18 |
+
google-pasta==0.2.0
|
| 19 |
+
grpcio==1.70.0
|
| 20 |
+
h5py==3.13.0
|
| 21 |
+
huggingface-hub==0.29.1
|
| 22 |
+
idna==3.10
|
| 23 |
+
Jinja2==3.1.5
|
| 24 |
+
jsonschema==4.23.0
|
| 25 |
+
jsonschema-specifications==2024.10.1
|
| 26 |
+
keras==3.8.0
|
| 27 |
+
libclang==18.1.1
|
| 28 |
+
Markdown==3.7
|
| 29 |
+
markdown-it-py==3.0.0
|
| 30 |
+
MarkupSafe==3.0.2
|
| 31 |
+
mdurl==0.1.2
|
| 32 |
+
ml-dtypes==0.4.1
|
| 33 |
+
namex==0.0.8
|
| 34 |
+
narwhals==1.27.1
|
| 35 |
+
numpy==2.0.2
|
| 36 |
+
opt_einsum==3.4.0
|
| 37 |
+
optree==0.14.0
|
| 38 |
+
packaging==24.2
|
| 39 |
+
pandas==2.2.3
|
| 40 |
+
pillow==11.1.0
|
| 41 |
+
protobuf==5.29.3
|
| 42 |
+
pyarrow==19.0.1
|
| 43 |
+
pydeck==0.9.1
|
| 44 |
+
Pygments==2.19.1
|
| 45 |
+
python-dateutil==2.9.0.post0
|
| 46 |
+
pytz==2025.1
|
| 47 |
+
PyYAML==6.0.2
|
| 48 |
+
referencing==0.36.2
|
| 49 |
+
requests==2.32.3
|
| 50 |
+
rich==13.9.4
|
| 51 |
+
rpds-py==0.23.0
|
| 52 |
+
six==1.17.0
|
| 53 |
+
smmap==5.0.2
|
| 54 |
+
soupsieve==2.6
|
| 55 |
+
streamlit==1.42.2
|
| 56 |
+
tenacity==9.0.0
|
| 57 |
+
tensorboard==2.18.0
|
| 58 |
+
tensorboard-data-server==0.7.2
|
| 59 |
+
tensorflow-io-gcs-filesystem==0.37.1
|
| 60 |
+
tensorflow_cpu==2.18.0
|
| 61 |
+
termcolor==2.5.0
|
| 62 |
+
toml==0.10.2
|
| 63 |
+
tornado==6.4.2
|
| 64 |
+
tqdm==4.67.1
|
| 65 |
+
typing_extensions==4.12.2
|
| 66 |
+
tzdata==2025.1
|
| 67 |
+
urllib3==2.3.0
|
| 68 |
+
watchdog==6.0.0
|
| 69 |
+
Werkzeug==3.1.3
|
| 70 |
+
wrapt==1.17.2
|