Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -14,11 +14,14 @@ class CustomHuggingFaceDatasetSaver(gr.FlaggingCallback):
|
|
14 |
self.hf_token = hf_token
|
15 |
self.dataset_name = dataset_name
|
16 |
|
17 |
-
def
|
18 |
if len(sample["output"]) > 1000:
|
19 |
sample["output"] = sample["output"][:1000] # Truncate output to 1000 characters
|
20 |
|
21 |
-
super().
|
|
|
|
|
|
|
22 |
|
23 |
# Set up flagging callback function
|
24 |
HF_TOKEN = os.getenv("HF_TOKEN")
|
|
|
14 |
self.hf_token = hf_token
|
15 |
self.dataset_name = dataset_name
|
16 |
|
17 |
+
def flag(self, sample):
|
18 |
if len(sample["output"]) > 1000:
|
19 |
sample["output"] = sample["output"][:1000] # Truncate output to 1000 characters
|
20 |
|
21 |
+
super().flag(sample)
|
22 |
+
|
23 |
+
def setup(self):
|
24 |
+
pass
|
25 |
|
26 |
# Set up flagging callback function
|
27 |
HF_TOKEN = os.getenv("HF_TOKEN")
|