rahulnair23 commited on
Commit
8ce3ca6
1 Parent(s): de201d8

Upgrading gradio + logging

Browse files
Files changed (3) hide show
  1. app.py +4 -0
  2. requirements.txt +1 -1
  3. selfrank/algos/triplet.py +3 -2
app.py CHANGED
@@ -1,6 +1,10 @@
1
  import gradio as gr
2
  from executors import benchmark_executor, synth_executor
3
  from gradio_rangeslider import RangeSlider
 
 
 
 
4
 
5
  class UI:
6
 
 
1
  import gradio as gr
2
  from executors import benchmark_executor, synth_executor
3
  from gradio_rangeslider import RangeSlider
4
+ import logging
5
+
6
+ logging.basicConfig(level=logging.INFO)
7
+ logger = logging.getLogger(__name__)
8
 
9
  class UI:
10
 
requirements.txt CHANGED
@@ -1,4 +1,4 @@
1
- gradio==4.39
2
  certifi==2023.7.22
3
  charset-normalizer==3.2.0
4
  idna==3.4
 
1
+ gradio==5.5
2
  certifi==2023.7.22
3
  charset-normalizer==3.2.0
4
  idna==3.4
selfrank/algos/triplet.py CHANGED
@@ -149,13 +149,14 @@ def noisy_equality(a: str, b:str, c:str, df:pd.DataFrame, p: float) -> int:
149
  return 0
150
 
151
 
 
 
152
  @call_counter
153
  def rouge(a: str, b: str, c:str, df: pd.DataFrame) -> float:
154
  """
155
  Summarization metric ROUGE2 - discrete version
156
  """
157
- scorer = rouge_scorer.RougeScorer(["rouge2"], use_stemmer=True)
158
-
159
  def __helper(x) -> int:
160
 
161
  score_a = scorer.score(x[c], x[a])['rouge2'].fmeasure
 
149
  return 0
150
 
151
 
152
+ scorer = rouge_scorer.RougeScorer(["rouge2"], use_stemmer=True)
153
+
154
  @call_counter
155
  def rouge(a: str, b: str, c:str, df: pd.DataFrame) -> float:
156
  """
157
  Summarization metric ROUGE2 - discrete version
158
  """
159
+
 
160
  def __helper(x) -> int:
161
 
162
  score_a = scorer.score(x[c], x[a])['rouge2'].fmeasure