Spaces:
Sleeping
Sleeping
Update app.py
Browse files
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("
|
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("
|
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("
|
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("
|
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")
|