maysonma commited on
Commit
3d97403
1 Parent(s): f21da2d

combine const and judge

Browse files
Files changed (2) hide show
  1. constants.py +0 -23
  2. judge.py +20 -3
constants.py DELETED
@@ -1,23 +0,0 @@
1
- # Source: https://github.com/wayveai/LingoQA/blob/main/benchmark/constants.py
2
-
3
- """
4
- LingoQA datasets are stored in Google Cloud.
5
- This file provides the download link for the datasets, as well as reference keys for the data.
6
- """
7
- from enum import Enum
8
-
9
- LINGOQA_TEST = "https://drive.usercontent.google.com/u/1/uc?id=1I8u6uYysQUstoVYZapyRQkXmOwr-AG3d&export=download"
10
-
11
- LINGO_JUDGE = "wayveai/Lingo-Judge"
12
-
13
- class Keys(str, Enum):
14
- question_id = "question_id"
15
- segment_id = "segment_id"
16
- question = "question"
17
- answer = "answer"
18
- references = "references"
19
- prediction = "prediction"
20
- max_score = "max_score"
21
- score = "score"
22
- probability = "probability"
23
- correct = "correct"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
judge.py CHANGED
@@ -1,11 +1,28 @@
1
  # Source: https://github.com/wayveai/LingoQA/blob/main/benchmark/judge.py
2
 
 
 
 
3
  import torch
4
  from torch import nn
5
-
6
- from typing import List
7
  from transformers import AutoModelForSequenceClassification, AutoTokenizer
8
- from .constants import LINGO_JUDGE
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
9
 
10
 
11
  class LingoJudge(nn.Module):
 
1
  # Source: https://github.com/wayveai/LingoQA/blob/main/benchmark/judge.py
2
 
3
+ from enum import Enum
4
+ from typing import List
5
+
6
  import torch
7
  from torch import nn
 
 
8
  from transformers import AutoModelForSequenceClassification, AutoTokenizer
9
+
10
+ LINGOQA_TEST = "https://drive.usercontent.google.com/u/1/uc?id=1I8u6uYysQUstoVYZapyRQkXmOwr-AG3d&export=download"
11
+
12
+ LINGO_JUDGE = "wayveai/Lingo-Judge"
13
+
14
+
15
+ class Keys(str, Enum):
16
+ question_id = "question_id"
17
+ segment_id = "segment_id"
18
+ question = "question"
19
+ answer = "answer"
20
+ references = "references"
21
+ prediction = "prediction"
22
+ max_score = "max_score"
23
+ score = "score"
24
+ probability = "probability"
25
+ correct = "correct"
26
 
27
 
28
  class LingoJudge(nn.Module):