ssk3232 commited on
Commit
eb5788b
1 Parent(s): e920e6e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -5
app.py CHANGED
@@ -3,7 +3,7 @@ import gradio as gr
3
  import pandas as pd
4
  from io import StringIO
5
 
6
- def predict_and_download(positive_csv_file, unlabelled_csv_file, n, text):
7
  selected_paper_info = oneclass.select_top_n_papers(n, positive_csv_file, unlabelled_csv_file)
8
 
9
  # Create a StringIO object to store CSV data
@@ -16,15 +16,13 @@ def predict_and_download(positive_csv_file, unlabelled_csv_file, n, text):
16
  csv_content = csv_buffer.getvalue()
17
 
18
 
19
-
20
-
21
  # Return selected_paper_info and CSV content
22
- return selected_paper_info, csv_content
23
 
24
  # Create the interface
25
  iface = gr.Interface(
26
  fn=predict_and_download,
27
- inputs=["file", "file", "number", "textbox"],
28
  outputs=[gr.DataFrame(label="Selected Papers"), gr.DownloadButton(label="Download CSV")],
29
  title="Paper Prediction",
30
  description="Enter text and upload CSV files for labelled and unlabelled data.",
 
3
  import pandas as pd
4
  from io import StringIO
5
 
6
+ def predict_and_download(positive_csv_file, unlabelled_csv_file, n):
7
  selected_paper_info = oneclass.select_top_n_papers(n, positive_csv_file, unlabelled_csv_file)
8
 
9
  # Create a StringIO object to store CSV data
 
16
  csv_content = csv_buffer.getvalue()
17
 
18
 
 
 
19
  # Return selected_paper_info and CSV content
20
+ return selected_paper_info, csv_buffer
21
 
22
  # Create the interface
23
  iface = gr.Interface(
24
  fn=predict_and_download,
25
+ inputs=["file", "file", "number"],
26
  outputs=[gr.DataFrame(label="Selected Papers"), gr.DownloadButton(label="Download CSV")],
27
  title="Paper Prediction",
28
  description="Enter text and upload CSV files for labelled and unlabelled data.",