Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -88,7 +88,7 @@ from datasets import load_dataset, Dataset
|
|
88 |
|
89 |
# Function to load the dataset from Hugging Face
|
90 |
def load_hf_dataset():
|
91 |
-
dataset = load_dataset("
|
92 |
return dataset["train"] # Access the dataset without split specification
|
93 |
|
94 |
def update_history_with_status(english, french, history, status):
|
@@ -112,7 +112,7 @@ def revert_last_action(history):
|
|
112 |
df = dataset.to_pandas()
|
113 |
df = df.drop(last_index).reset_index(drop=True)
|
114 |
updated_dataset = Dataset.from_pandas(df)
|
115 |
-
updated_dataset.push_to_hub("
|
116 |
return history_text, history
|
117 |
|
118 |
# Function to flag data
|
@@ -122,7 +122,7 @@ def flag_action(english, french, corrected_french, flagged_successful, history):
|
|
122 |
df = dataset.to_pandas()
|
123 |
df = df.append(data, ignore_index=True)
|
124 |
updated_dataset = Dataset.from_pandas(df)
|
125 |
-
updated_dataset.push_to_hub("
|
126 |
index = len(df) - 1
|
127 |
row_indices.append(index)
|
128 |
return update_history_with_status(english, french, history, "Flagged")
|
@@ -134,7 +134,7 @@ def accept_action(english, french, hidden_text, flagged_successful, history):
|
|
134 |
df = dataset.to_pandas()
|
135 |
df = df.append(data, ignore_index=True)
|
136 |
updated_dataset = Dataset.from_pandas(df)
|
137 |
-
updated_dataset.push_to_hub("
|
138 |
index = len(df) - 1
|
139 |
row_indices.append(index)
|
140 |
return update_history_with_status(english, french, history, "Accepted")
|
|
|
88 |
|
89 |
# Function to load the dataset from Hugging Face
|
90 |
def load_hf_dataset():
|
91 |
+
dataset = load_dataset("Zaherrr/translation_log")
|
92 |
return dataset["train"] # Access the dataset without split specification
|
93 |
|
94 |
def update_history_with_status(english, french, history, status):
|
|
|
112 |
df = dataset.to_pandas()
|
113 |
df = df.drop(last_index).reset_index(drop=True)
|
114 |
updated_dataset = Dataset.from_pandas(df)
|
115 |
+
updated_dataset.push_to_hub("Zaherrr/translation_log")
|
116 |
return history_text, history
|
117 |
|
118 |
# Function to flag data
|
|
|
122 |
df = dataset.to_pandas()
|
123 |
df = df.append(data, ignore_index=True)
|
124 |
updated_dataset = Dataset.from_pandas(df)
|
125 |
+
updated_dataset.push_to_hub("Zaherrr/translation_log")
|
126 |
index = len(df) - 1
|
127 |
row_indices.append(index)
|
128 |
return update_history_with_status(english, french, history, "Flagged")
|
|
|
134 |
df = dataset.to_pandas()
|
135 |
df = df.append(data, ignore_index=True)
|
136 |
updated_dataset = Dataset.from_pandas(df)
|
137 |
+
updated_dataset.push_to_hub("Zaherrr/translation_log")
|
138 |
index = len(df) - 1
|
139 |
row_indices.append(index)
|
140 |
return update_history_with_status(english, french, history, "Accepted")
|