Spaces:
Sleeping
Sleeping
Commit
·
4b4013f
1
Parent(s):
63e083c
message
Browse files- .gitignore +1 -0
- app.py +23 -4
.gitignore
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
.streamlit/
|
app.py
CHANGED
|
@@ -3,8 +3,8 @@ import streamlit as st
|
|
| 3 |
radioButtonList = ["E-commerce CSV (https://www.kaggle.com/datasets/mervemenekse/ecommerce-dataset)",
|
| 4 |
"Upload my own CSV",
|
| 5 |
"Upload my own PDF",
|
| 6 |
-
"URL Chat with Google Alphabet's 2022 Q2 Earnings (https://shorturl.at/csCK3)",
|
| 7 |
-
"Enter my own URL
|
| 8 |
genre = st.radio(
|
| 9 |
"Choose dataset to finetune", radioButtonList
|
| 10 |
)
|
|
@@ -12,8 +12,27 @@ genre = st.radio(
|
|
| 12 |
if genre==radioButtonList[0]:
|
| 13 |
st.write('You selected comedy.')
|
| 14 |
else:
|
| 15 |
-
st.write(
|
| 16 |
|
| 17 |
isCustomURL = genre==radioButtonList[4]
|
| 18 |
-
title = st.text_input('Enter your own URL', '
|
| 19 |
st.write('The current movie title is', title)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3 |
radioButtonList = ["E-commerce CSV (https://www.kaggle.com/datasets/mervemenekse/ecommerce-dataset)",
|
| 4 |
"Upload my own CSV",
|
| 5 |
"Upload my own PDF",
|
| 6 |
+
"URL Chat with Google Alphabet's 2022 Q2 Earnings Report (https://shorturl.at/csCK3)",
|
| 7 |
+
"Enter my own URL"]
|
| 8 |
genre = st.radio(
|
| 9 |
"Choose dataset to finetune", radioButtonList
|
| 10 |
)
|
|
|
|
| 12 |
if genre==radioButtonList[0]:
|
| 13 |
st.write('You selected comedy.')
|
| 14 |
else:
|
| 15 |
+
st.write(f'''Password streamlit app: {st.secrets["PSWD"]}''')
|
| 16 |
|
| 17 |
isCustomURL = genre==radioButtonList[4]
|
| 18 |
+
title = st.text_input('Enter your own URL', 'https://shorturl.at/csCK3', disabled=not isCustomURL)
|
| 19 |
st.write('The current movie title is', title)
|
| 20 |
+
|
| 21 |
+
isCustomPDF = genre==radioButtonList[2]
|
| 22 |
+
uploaded_file = st.file_uploader("Upload your own PDF here", disabled=not isCustomPDF)
|
| 23 |
+
if uploaded_file is not None:
|
| 24 |
+
# To read file as bytes:
|
| 25 |
+
bytes_data = uploaded_file.getvalue()
|
| 26 |
+
st.write(bytes_data)
|
| 27 |
+
|
| 28 |
+
# To convert to a string based IO:
|
| 29 |
+
stringio = StringIO(uploaded_file.getvalue().decode("utf-8"))
|
| 30 |
+
st.write(stringio)
|
| 31 |
+
|
| 32 |
+
# To read file as string:
|
| 33 |
+
string_data = stringio.read()
|
| 34 |
+
st.write(string_data)
|
| 35 |
+
|
| 36 |
+
# Can be used wherever a "file-like" object is accepted:
|
| 37 |
+
dataframe = pd.read_csv(uploaded_file)
|
| 38 |
+
st.write(dataframe)
|