rockdrigoma commited on
Commit
24dbdff
1 Parent(s): 28aaaed

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -1
app.py CHANGED
@@ -98,6 +98,10 @@ def predict(input):
98
  outputs = model.generate(input_ids, max_length=512)
99
  outputs = tokenizer.batch_decode(outputs, skip_special_tokens=True)[0]
100
  return outputs
 
 
 
 
101
 
102
  gr.Interface(
103
  fn=predict,
@@ -122,5 +126,5 @@ gr.Interface(
122
  article=article,
123
  allow_flagging="manual",
124
  flagging_options=["right translation", "wrong translation", "error", "other"],
125
- flagging_dir="logs"
126
  ).launch(enable_queue=True)
 
98
  outputs = model.generate(input_ids, max_length=512)
99
  outputs = tokenizer.batch_decode(outputs, skip_special_tokens=True)[0]
100
  return outputs
101
+
102
+ HF_TOKEN = os.getenv('spanish-nahuatl-flagging')
103
+
104
+ hf_writer = gr.HuggingFaceDatasetSaver(HF_TOKEN, "spanish-nahuatl-flagging")
105
 
106
  gr.Interface(
107
  fn=predict,
 
126
  article=article,
127
  allow_flagging="manual",
128
  flagging_options=["right translation", "wrong translation", "error", "other"],
129
+ flagging_callback=hf_writer,
130
  ).launch(enable_queue=True)