nandezgarcia commited on
Commit
f8c1ea5
·
verified ·
1 Parent(s): c2c9ca6

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -6
app.py CHANGED
@@ -7,7 +7,7 @@ from huggingface_hub import HfApi, create_repo, upload_file
7
  from datasets import Dataset
8
 
9
  # File paths
10
- INPUT_CSV = "summaries_boe.csv" # Change this to your input CSV path
11
  OUTPUT_CSV = "results.csv" # Local backup file path
12
  TEMP_JSON = "temp_results.jsonl" # Temporary file for storing results as JSONL
13
 
@@ -22,7 +22,7 @@ def load_data():
22
  return pd.read_csv(INPUT_CSV)
23
  else:
24
  # Create empty dataframe with required columns if file doesn't exist
25
- return pd.DataFrame(columns=["id", "boe_text_cleaned", "tweet_text_cleaned", "tweet_original"])
26
 
27
  def initialize_hf_dataset():
28
  """Initialize a HuggingFace dataset repository if it doesn't exist"""
@@ -222,11 +222,11 @@ with gr.Blocks(title="Summary Chooser") as interface:
222
  result_box = gr.Textbox(label="Result")
223
 
224
  # Initialize with the first item
225
- id, boe_text_cleaned, tweet_text_cleaned, tweet_original, prog = app.get_current_item()
226
  text_id_box.value = id
227
- text_box.value = boe_text_cleaned
228
- summary_a.value = tweet_text_cleaned
229
- summary_b.value = tweet_original
230
  progress_label.value = prog
231
 
232
  # Set up event handlers
 
7
  from datasets import Dataset
8
 
9
  # File paths
10
+ INPUT_CSV = "summaries.csv" # Change this to your input CSV path
11
  OUTPUT_CSV = "results.csv" # Local backup file path
12
  TEMP_JSON = "temp_results.jsonl" # Temporary file for storing results as JSONL
13
 
 
22
  return pd.read_csv(INPUT_CSV)
23
  else:
24
  # Create empty dataframe with required columns if file doesn't exist
25
+ return pd.DataFrame(columns=["text_id", "text", "summary_a", "summary_b"])
26
 
27
  def initialize_hf_dataset():
28
  """Initialize a HuggingFace dataset repository if it doesn't exist"""
 
222
  result_box = gr.Textbox(label="Result")
223
 
224
  # Initialize with the first item
225
+ text_id, text, summary_a, summary_b, prog = app.get_current_item()
226
  text_id_box.value = id
227
+ text_box.value = text
228
+ summary_a.value = summary_a
229
+ summary_b.value = summary_b
230
  progress_label.value = prog
231
 
232
  # Set up event handlers