Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -120,7 +120,8 @@ def flag_action(english, french, corrected_french, flagged_successful, history):
|
|
120 |
data = {"english": english, "french": french, "corrected_french": corrected_french, "status": flagged_successful}
|
121 |
dataset = load_hf_dataset()
|
122 |
df = dataset.to_pandas()
|
123 |
-
|
|
|
124 |
updated_dataset = Dataset.from_pandas(df)
|
125 |
updated_dataset.push_to_hub("Zaherrr/translation_log")
|
126 |
index = len(df) - 1
|
@@ -132,7 +133,8 @@ def accept_action(english, french, hidden_text, flagged_successful, history):
|
|
132 |
data = {"english": english, "french": french, "corrected_french": hidden_text, "status": flagged_successful}
|
133 |
dataset = load_hf_dataset()
|
134 |
df = dataset.to_pandas()
|
135 |
-
|
|
|
136 |
updated_dataset = Dataset.from_pandas(df)
|
137 |
updated_dataset.push_to_hub("Zaherrr/translation_log")
|
138 |
index = len(df) - 1
|
|
|
120 |
data = {"english": english, "french": french, "corrected_french": corrected_french, "status": flagged_successful}
|
121 |
dataset = load_hf_dataset()
|
122 |
df = dataset.to_pandas()
|
123 |
+
new_df = pd.DataFrame([data])
|
124 |
+
df = pd.concat([df, new_df], ignore_index=True)
|
125 |
updated_dataset = Dataset.from_pandas(df)
|
126 |
updated_dataset.push_to_hub("Zaherrr/translation_log")
|
127 |
index = len(df) - 1
|
|
|
133 |
data = {"english": english, "french": french, "corrected_french": hidden_text, "status": flagged_successful}
|
134 |
dataset = load_hf_dataset()
|
135 |
df = dataset.to_pandas()
|
136 |
+
new_df = pd.DataFrame([data])
|
137 |
+
df = pd.concat([df, new_df], ignore_index=True)
|
138 |
updated_dataset = Dataset.from_pandas(df)
|
139 |
updated_dataset.push_to_hub("Zaherrr/translation_log")
|
140 |
index = len(df) - 1
|