sasha HF Staff commited on
Commit
9cb48f2
Β·
verified Β·
1 Parent(s): adebb34

Update app.py

Browse files

removing classes we don't need

Files changed (1) hide show
  1. app.py +0 -34
app.py CHANGED
@@ -22,46 +22,12 @@ requests= load_dataset("EnergyStarAI/requests_debug", split="test", token=TOKEN)
22
  tasks = ['ASR', 'Object Detection', 'Text Classification', 'Image Captioning', 'Question Answering', 'Text Generation', 'Image Classification',
23
  'Sentence Similarity', 'Image Generation', 'Summarization']
24
 
25
-
26
- ##### Data classes need for the leaderboard Submit Model menu. #####
27
  @dataclass
28
  class ModelDetails:
29
  name: str
30
  display_name: str = ""
31
  symbol: str = "" # emoji
32
 
33
- class WeightType(Enum):
34
- Adapter = ModelDetails("Adapter")
35
- Original = ModelDetails("Original")
36
- Delta = ModelDetails("Delta")
37
-
38
-
39
- class ModelType(Enum):
40
- PT = ModelDetails(name="pretrained", symbol="🟒")
41
- FT = ModelDetails(name="fine-tuned", symbol="πŸ”Ά")
42
- IFT = ModelDetails(name="instruction-tuned", symbol="β­•")
43
- RL = ModelDetails(name="RL-tuned", symbol="🟦")
44
- Unknown = ModelDetails(name="", symbol="?")
45
-
46
- def to_str(self, separator=" "):
47
- return f"{self.value.symbol}{separator}{self.value.name}"
48
-
49
- @staticmethod
50
- def from_str(type):
51
- if "fine-tuned" in type or "πŸ”Ά" in type:
52
- return ModelType.FT
53
- if "pretrained" in type or "🟒" in type:
54
- return ModelType.PT
55
- if "RL-tuned" in type or "🟦" in type:
56
- return ModelType.RL
57
- if "instruction-tuned" in type or "β­•" in type:
58
- return ModelType.IFT
59
- return ModelType.Unknown
60
-
61
- ##### End of classes required by the leaderboard Submit Model menu #####
62
-
63
-
64
-
65
  def start_compute_space():
66
  API.restart_space(COMPUTE_SPACE)
67
  return f"Okay! {COMPUTE_SPACE} should be running now!"
 
22
  tasks = ['ASR', 'Object Detection', 'Text Classification', 'Image Captioning', 'Question Answering', 'Text Generation', 'Image Classification',
23
  'Sentence Similarity', 'Image Generation', 'Summarization']
24
 
 
 
25
  @dataclass
26
  class ModelDetails:
27
  name: str
28
  display_name: str = ""
29
  symbol: str = "" # emoji
30
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
31
  def start_compute_space():
32
  API.restart_space(COMPUTE_SPACE)
33
  return f"Okay! {COMPUTE_SPACE} should be running now!"