EE21 commited on
Commit
c7464b2
1 Parent(s): 7a5c42f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -3
app.py CHANGED
@@ -12,7 +12,7 @@ from keyphrase_extraction import extract_sentences_with_obligations
12
  dataset = load_dataset("EE21/ToS-Summaries")
13
 
14
  # Extract titles or identifiers for the ToS
15
- tos_titles = ["None"] + [f"Document {i}" for i in range(len(dataset['train']))]
16
 
17
  # Set page to wide mode
18
  st.set_page_config(layout="wide")
@@ -64,8 +64,7 @@ def main():
64
  st.write("PDF uploaded successfully.")
65
  elif user_input:
66
  file_content = user_input
67
- elif tos_selection_index != "None":
68
- tos_selection_index = tos_titles.index(tos_titles) - 1 # Adjust for the added 'None' option
69
  file_content = dataset['train'][tos_selection_index]['plain_text']
70
  else:
71
  st.warning("Please upload a PDF, enter some text, or select a document to summarize.")
 
12
  dataset = load_dataset("EE21/ToS-Summaries")
13
 
14
  # Extract titles or identifiers for the ToS
15
+ tos_titles = [f"Document {i}" for i in range(len(dataset['train']))]
16
 
17
  # Set page to wide mode
18
  st.set_page_config(layout="wide")
 
64
  st.write("PDF uploaded successfully.")
65
  elif user_input:
66
  file_content = user_input
67
+ elif tos_selection_index is not None:
 
68
  file_content = dataset['train'][tos_selection_index]['plain_text']
69
  else:
70
  st.warning("Please upload a PDF, enter some text, or select a document to summarize.")