cointegrated commited on
Commit
fe73ea4
·
1 Parent(s): dbc3e80

fix properties

Browse files
Files changed (2) hide show
  1. app.py +2 -1
  2. blaser_2_0_qe.py +3 -3
app.py CHANGED
@@ -2,5 +2,6 @@ import evaluate
2
  from evaluate.utils import launch_gradio_widget
3
 
4
 
5
- module = evaluate.load("cointegrated/blaser_2_0_qe")
 
6
  launch_gradio_widget(module)
 
2
  from evaluate.utils import launch_gradio_widget
3
 
4
 
5
+ # module = evaluate.load("cointegrated/blaser_2_0_qe")
6
+ module = evaluate.load("./blaser_2_0_qe.py")
7
  launch_gradio_widget(module)
blaser_2_0_qe.py CHANGED
@@ -94,12 +94,12 @@ class BLASER20QE(evaluate.Metric):
94
  def _compute(self, sources, translations):
95
  """Returns the scores"""
96
  # TODO: adjust the languages
97
- src_embs = text_embedder.predict(sources, source_lang="eng_Latn")
98
- mt_embs = text_embedder.predict(translations, source_lang="eng_Latn")
99
 
100
  with torch.inference_mode():
101
  #ref_score = blaser_ref(src=src_embs, ref=ref_embs, mt=mt_embs).mean().item()
102
- qe_score = blaser_qe(src=src_embs, mt=mt_embs).mean().item()
103
 
104
  return {
105
  "BLASER 2.0-QE": qe_score,
 
94
  def _compute(self, sources, translations):
95
  """Returns the scores"""
96
  # TODO: adjust the languages
97
+ src_embs = self.text_embedder.predict(sources, source_lang="eng_Latn")
98
+ mt_embs = self.text_embedder.predict(translations, source_lang="eng_Latn")
99
 
100
  with torch.inference_mode():
101
  #ref_score = blaser_ref(src=src_embs, ref=ref_embs, mt=mt_embs).mean().item()
102
+ qe_score = self.blaser_qe(src=src_embs, mt=mt_embs).mean().item()
103
 
104
  return {
105
  "BLASER 2.0-QE": qe_score,