Andinda commited on
Commit
aabb16c
·
verified ·
1 Parent(s): 670cc01
Files changed (1) hide show
  1. app.py +10 -0
app.py CHANGED
@@ -43,6 +43,16 @@ if input_method == 'Select from Examples':
43
  elif input_method == "Write or Paste New Text":
44
  st.subheader("Text to Run")
45
  input_text = st.text_area('Write or Paste Text Below', value="", height=128, max_chars=None, key=2)
 
 
 
 
 
 
 
 
 
 
46
 
47
  @st.cache_resource
48
  def setModel(model_checkpoint, aggregation):
 
43
  elif input_method == "Write or Paste New Text":
44
  st.subheader("Text to Run")
45
  input_text = st.text_area('Write or Paste Text Below', value="", height=128, max_chars=None, key=2)
46
+ elif input_method == "Upload CSV File":
47
+ st.subheader("Upload CSV File")
48
+ uploaded_file = st.file_uploader("Choose a CSV file", type="csv")
49
+
50
+ if uploaded_file is not None:
51
+ df_csv = pd.read_csv(uploaded_file)
52
+ st.write(df_csv)
53
+ text_column = st.selectbox("Select the column containing text", df_csv.columns)
54
+ input_text = df_csv[text_column].iloc[0] # Taking the first row as input for simplicity
55
+
56
 
57
  @st.cache_resource
58
  def setModel(model_checkpoint, aggregation):