CannaTech commited on
Commit
9b153c2
·
1 Parent(s): cb5d309

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -2
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 on_flag(self, sample):
18
  if len(sample["output"]) > 1000:
19
  sample["output"] = sample["output"][:1000] # Truncate output to 1000 characters
20
 
21
- super().on_flag(sample)
 
 
 
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")