Chris4K commited on
Commit
d2826a9
·
verified ·
1 Parent(s): 7118235

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +26 -0
app.py CHANGED
@@ -25,7 +25,33 @@ st.title("Hugging Face Agent and tools")
25
  ## LB https://huggingface.co/spaces/qiantong-xu/toolbench-leaderboard
26
 
27
  st.markdown("Welcome to the Hugging Face Agent and Tools app! This app allows you to interact with various tools using the Hugging Face API.")
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
28
 
 
 
 
 
 
 
 
 
 
 
29
  # Create a page with tabs
30
  tabs = st.tabs(["Chat", "URL, Tools and logging", "User Description", "Developers"])
31
 
 
25
  ## LB https://huggingface.co/spaces/qiantong-xu/toolbench-leaderboard
26
 
27
  st.markdown("Welcome to the Hugging Face Agent and Tools app! This app allows you to interact with various tools using the Hugging Face API.")
28
+
29
+ #######
30
+
31
+ import pandas as pd
32
+ from io import StringIO
33
+ with st.sidebar:
34
+
35
+ uploaded_file = st.file_uploader("Choose a file")
36
+ if uploaded_file is not None:
37
+ # To read file as bytes:
38
+ bytes_data = uploaded_file.getvalue()
39
+ st.write(bytes_data)
40
+
41
+ # To convert to a string based IO:
42
+ stringio = StringIO(uploaded_file.getvalue().decode("utf-8"))
43
+ st.write(stringio)
44
 
45
+ # To read file as string:
46
+ string_data = stringio.read()
47
+ st.write(string_data)
48
+
49
+ # Can be used wherever a "file-like" object is accepted:
50
+ dataframe = pd.read_csv(uploaded_file)
51
+ st.write(dataframe)
52
+
53
+ ########
54
+
55
  # Create a page with tabs
56
  tabs = st.tabs(["Chat", "URL, Tools and logging", "User Description", "Developers"])
57