Zaherrr commited on
Commit
31c01ee
·
verified ·
1 Parent(s): 4fd611d

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -4
app.py CHANGED
@@ -88,7 +88,7 @@ from datasets import load_dataset, Dataset, DatasetDict
88
 
89
  # Load the private dataset from Hugging Face
90
  def load_hf_dataset():
91
- dataset = load_dataset("your_hf_username/translation_log", split="train")
92
  return dataset
93
 
94
  def update_history_with_status(english, french, history, status):
@@ -113,7 +113,7 @@ def revert_last_action(history):
113
  df = df.drop(last_index).reset_index(drop=True)
114
  updated_dataset = Dataset.from_pandas(df)
115
  dataset_dict = DatasetDict({"train": updated_dataset})
116
- dataset_dict.push_to_hub("your_hf_username/translation_log")
117
  return history_text, history
118
 
119
  # Function to flag data
@@ -124,7 +124,7 @@ def flag_action(english, french, corrected_french, flagged_successful, history):
124
  df = df.append(data, ignore_index=True)
125
  updated_dataset = Dataset.from_pandas(df)
126
  dataset_dict = DatasetDict({"train": updated_dataset})
127
- dataset_dict.push_to_hub("your_hf_username/translation_log")
128
  index = len(df) - 1
129
  row_indices.append(index)
130
  return update_history_with_status(english, french, history, "Flagged")
@@ -137,7 +137,7 @@ def accept_action(english, french, hidden_text, flagged_successful, history):
137
  df = df.append(data, ignore_index=True)
138
  updated_dataset = Dataset.from_pandas(df)
139
  dataset_dict = DatasetDict({"train": updated_dataset})
140
- dataset_dict.push_to_hub("your_hf_username/translation_log")
141
  index = len(df) - 1
142
  row_indices.append(index)
143
  return update_history_with_status(english, french, history, "Accepted")
 
88
 
89
  # Load the private dataset from Hugging Face
90
  def load_hf_dataset():
91
+ dataset = load_dataset("Zaherrr/translation_log", split="train")
92
  return dataset
93
 
94
  def update_history_with_status(english, french, history, status):
 
113
  df = df.drop(last_index).reset_index(drop=True)
114
  updated_dataset = Dataset.from_pandas(df)
115
  dataset_dict = DatasetDict({"train": updated_dataset})
116
+ dataset_dict.push_to_hub("Zaherrr/translation_log")
117
  return history_text, history
118
 
119
  # Function to flag data
 
124
  df = df.append(data, ignore_index=True)
125
  updated_dataset = Dataset.from_pandas(df)
126
  dataset_dict = DatasetDict({"train": updated_dataset})
127
+ dataset_dict.push_to_hub("Zaherrr/translation_log")
128
  index = len(df) - 1
129
  row_indices.append(index)
130
  return update_history_with_status(english, french, history, "Flagged")
 
137
  df = df.append(data, ignore_index=True)
138
  updated_dataset = Dataset.from_pandas(df)
139
  dataset_dict = DatasetDict({"train": updated_dataset})
140
+ dataset_dict.push_to_hub("Zaherrr/translation_log")
141
  index = len(df) - 1
142
  row_indices.append(index)
143
  return update_history_with_status(english, french, history, "Accepted")