Spaces:
Running
Running
ashhadahsan
commited on
Commit
·
e7ee4c6
1
Parent(s):
915e04a
added file handling
Browse files
app.py
CHANGED
@@ -38,11 +38,17 @@ summarizer_option = st.selectbox(
|
|
38 |
"Select Summarizer",
|
39 |
("Custom trained on the dataset", "t5-base", "t5-one-line-summary"),
|
40 |
)
|
|
|
|
|
|
|
41 |
ps = st.empty()
|
42 |
if st.button("Process"):
|
43 |
if uploaded_file is not None:
|
|
|
44 |
|
45 |
-
|
|
|
|
|
46 |
columns = df.columns.values.tolist()
|
47 |
columns = [x.lower() for x in columns]
|
48 |
df.columns = columns
|
|
|
38 |
"Select Summarizer",
|
39 |
("Custom trained on the dataset", "t5-base", "t5-one-line-summary"),
|
40 |
)
|
41 |
+
|
42 |
+
print(uploaded_file.name)
|
43 |
+
|
44 |
ps = st.empty()
|
45 |
if st.button("Process"):
|
46 |
if uploaded_file is not None:
|
47 |
+
if uploaded_file.name.split(".")[-1] in ["xls", "xlsx"]:
|
48 |
|
49 |
+
df = pd.read_excel(uploaded_file, engine="openpyxl")
|
50 |
+
if uploaded_file.name.split(".")[-1] in [".csv"]:
|
51 |
+
df = pd.read_csv(uploaded_file)
|
52 |
columns = df.columns.values.tolist()
|
53 |
columns = [x.lower() for x in columns]
|
54 |
df.columns = columns
|