Spaces:
Runtime error
Runtime error
dhiraj5678
commited on
Commit
•
8df8e49
1
Parent(s):
dac3c9d
Update app.py
Browse files
app.py
CHANGED
@@ -7,10 +7,18 @@ model = AutoModelForSeq2SeqLM.from_pretrained("facebook/bart-large-cnn")
|
|
7 |
import streamlit as st
|
8 |
import os
|
9 |
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
|
|
14 |
|
15 |
-
|
16 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
7 |
import streamlit as st
|
8 |
import os
|
9 |
|
10 |
+
uploaded_file = st.file_uploader("Choose a file")
|
11 |
+
if uploaded_file is not None:
|
12 |
+
# To read file as bytes:
|
13 |
+
bytes_data = uploaded_file.getvalue()
|
14 |
+
st.write(bytes_data)
|
15 |
|
16 |
+
# To convert to a string based IO:
|
17 |
+
stringio = StringIO(uploaded_file.getvalue().decode("utf-8"))
|
18 |
+
st.write(stringio)
|
19 |
+
|
20 |
+
# To read file as string:
|
21 |
+
string_data = stringio.read()
|
22 |
+
st.write(string_data)
|
23 |
+
|
24 |
+
|