aliasgerovs commited on
Commit
1f1f784
·
1 Parent(s): 98f8ec9
Files changed (2) hide show
  1. app.py +5 -5
  2. predictors.py +10 -10
app.py CHANGED
@@ -128,11 +128,11 @@ with gr.Blocks() as demo:
128
  char_count = gr.Textbox(label="Minumum Character Limit Check")
129
  input_text.change(fn=len_validator, inputs=input_text, outputs=char_count)
130
 
131
- with gr.Row():
132
- btn = gr.Button("Bias Buster")
133
- out = gr.Textbox(label="Bias Corrected Full Input", interactive=False)
134
- corrections_output = gr.Textbox(label="Bias Corrections", interactive=False)
135
- btn.click(fn=update, inputs=input_text, outputs=[out, corrections_output])
136
 
137
  with gr.Row():
138
  models = gr.Dropdown(
 
128
  char_count = gr.Textbox(label="Minumum Character Limit Check")
129
  input_text.change(fn=len_validator, inputs=input_text, outputs=char_count)
130
 
131
+ # with gr.Row():
132
+ # btn = gr.Button("Bias Buster")
133
+ # out = gr.Textbox(label="Bias Corrected Full Input", interactive=False)
134
+ # corrections_output = gr.Textbox(label="Bias Corrections", interactive=False)
135
+ # btn.click(fn=update, inputs=input_text, outputs=[out, corrections_output])
136
 
137
  with gr.Row():
138
  models = gr.Dropdown(
predictors.py CHANGED
@@ -78,16 +78,16 @@ text_bc_model = BetterTransformer.transform(text_bc_model)
78
  text_mc_model = BetterTransformer.transform(text_mc_model)
79
  quillbot_model = BetterTransformer.transform(quillbot_model)
80
 
81
- bias_model_checker = AutoModelForSequenceClassification.from_pretrained(bias_checker_model_name)
82
- tokenizer = AutoTokenizer.from_pretrained(bias_checker_model_name)
83
- bias_model_checker = BetterTransformer.transform(bias_model_checker, keep_original_model=False)
84
- bias_checker = pipeline(
85
- "text-classification",
86
- model=bias_checker_model_name,
87
- tokenizer=bias_checker_model_name,
88
- )
89
- gc.collect()
90
- bias_corrector = pipeline( "text2text-generation", model=bias_corrector_model_name, accelerator="ort")
91
 
92
  # model score calibration
93
  iso_reg = joblib.load("isotonic_regression_model.joblib")
 
78
  text_mc_model = BetterTransformer.transform(text_mc_model)
79
  quillbot_model = BetterTransformer.transform(quillbot_model)
80
 
81
+ # bias_model_checker = AutoModelForSequenceClassification.from_pretrained(bias_checker_model_name)
82
+ # tokenizer = AutoTokenizer.from_pretrained(bias_checker_model_name)
83
+ # bias_model_checker = BetterTransformer.transform(bias_model_checker, keep_original_model=False)
84
+ # bias_checker = pipeline(
85
+ # "text-classification",
86
+ # model=bias_checker_model_name,
87
+ # tokenizer=bias_checker_model_name,
88
+ # )
89
+ # gc.collect()
90
+ # bias_corrector = pipeline( "text2text-generation", model=bias_corrector_model_name, accelerator="ort")
91
 
92
  # model score calibration
93
  iso_reg = joblib.load("isotonic_regression_model.joblib")