Enutrof commited on
Commit
f561e39
1 Parent(s): 4f1bc8b

Removed flagging

Browse files
Files changed (1) hide show
  1. app.py +11 -11
app.py CHANGED
@@ -2,13 +2,13 @@ import os
2
  import gradio as gr
3
  from simpletransformers.seq2seq import Seq2SeqModel, Seq2SeqArgs
4
 
5
- os.environ["TOKENIZERS_PARALLELISM"] = "false"
6
 
7
 
8
  def load_translator(model_name='Enutrof/marian-mt-en-pcm'):
9
  '''
10
  This method loads the sequence to sequence model for translation.
11
- :return:
12
  '''
13
  pmodel_args = Seq2SeqArgs()
14
  pmodel_args.max_length = 1024
@@ -34,11 +34,11 @@ def predict(input):
34
  return [i.replace('▁', ' ') for i in predictions[0]]
35
 
36
 
37
- HF_TOKEN = os.getenv('english-pidgin-flagging')
38
- hf_writer = gr.HuggingFaceDatasetSaver(HF_TOKEN,
39
- dataset_name="English-NigerianPidgin-Result-Validation",
40
- organization="Enutrof",
41
- )
42
  gr.Interface(
43
  fn=predict,
44
  inputs=gr.inputs.Textbox(lines=1, label="Input Text in English"),
@@ -59,8 +59,8 @@ gr.Interface(
59
  'What are you looking for?',
60
  'I am lost please help me find my way to the market.',
61
  ],
62
- allow_flagging="manual",
63
- flagging_options=["Translation 1 is most correct", "Translation 2 is most correct",
64
- "Translation 3 is most correct"],
65
- flagging_callback=hf_writer,
66
  ).launch(enable_queue=True)
 
2
  import gradio as gr
3
  from simpletransformers.seq2seq import Seq2SeqModel, Seq2SeqArgs
4
 
5
+ # os.environ["TOKENIZERS_PARALLELISM"] = "false"
6
 
7
 
8
  def load_translator(model_name='Enutrof/marian-mt-en-pcm'):
9
  '''
10
  This method loads the sequence to sequence model for translation.
11
+ :return: model
12
  '''
13
  pmodel_args = Seq2SeqArgs()
14
  pmodel_args.max_length = 1024
 
34
  return [i.replace('▁', ' ') for i in predictions[0]]
35
 
36
 
37
+ #HF_TOKEN = os.getenv('english-pidgin-flagging')
38
+ # hf_writer = gr.HuggingFaceDatasetSaver(HF_TOKEN,
39
+ # dataset_name="English-NigerianPidgin-Result-Validation",
40
+ # organization="Enutrof",
41
+ # )
42
  gr.Interface(
43
  fn=predict,
44
  inputs=gr.inputs.Textbox(lines=1, label="Input Text in English"),
 
59
  'What are you looking for?',
60
  'I am lost please help me find my way to the market.',
61
  ],
62
+ #allow_flagging="manual",
63
+ #flagging_options=["Translation 1 is most correct", "Translation 2 is most correct",
64
+ # "Translation 3 is most correct"],
65
+ # flagging_callback=hf_writer,
66
  ).launch(enable_queue=True)