sanchit-gandhi HF staff commited on
Commit
00744e7
1 Parent(s): fe693ae

Update vision and audio models

Browse files
Files changed (2) hide show
  1. app.py +24 -7
  2. requirements.txt +1 -1
app.py CHANGED
@@ -11,6 +11,8 @@ from transformers.models.auto.configuration_auto import CONFIG_MAPPING_NAMES
11
  from transformers.models.auto.modeling_auto import (
12
  MODEL_FOR_CTC_MAPPING_NAMES,
13
  MODEL_FOR_AUDIO_CLASSIFICATION_MAPPING_NAMES,
 
 
14
  MODEL_FOR_SPEECH_SEQ_2_SEQ_MAPPING_NAMES,
15
  MODEL_FOR_VISION_2_SEQ_MAPPING_NAMES,
16
  MODEL_FOR_INSTANCE_SEGMENTATION_MAPPING_NAMES,
@@ -18,11 +20,23 @@ from transformers.models.auto.modeling_auto import (
18
  MODEL_FOR_IMAGE_CLASSIFICATION_MAPPING_NAMES,
19
  MODEL_FOR_CAUSAL_IMAGE_MODELING_MAPPING_NAMES,
20
  MODEL_FOR_MASKED_IMAGE_MODELING_MAPPING_NAMES,
 
 
 
 
 
21
  )
22
 
23
- audio_models = list(MODEL_FOR_CTC_MAPPING_NAMES.keys()) + list(MODEL_FOR_AUDIO_CLASSIFICATION_MAPPING_NAMES.keys()) + list(MODEL_FOR_SPEECH_SEQ_2_SEQ_MAPPING_NAMES.keys())
 
 
24
 
25
- vision_models = ["clip"] + list(MODEL_FOR_VISION_2_SEQ_MAPPING_NAMES.keys()) + list(MODEL_FOR_INSTANCE_SEGMENTATION_MAPPING_NAMES.keys()) + list(MODEL_FOR_SEMANTIC_SEGMENTATION_MAPPING_NAMES.keys()) + list(MODEL_FOR_IMAGE_CLASSIFICATION_MAPPING_NAMES.keys()) + list(MODEL_FOR_CAUSAL_IMAGE_MODELING_MAPPING_NAMES.keys()) + list(MODEL_FOR_MASKED_IMAGE_MODELING_MAPPING_NAMES.keys())
 
 
 
 
 
26
 
27
  today = datetime.date.today()
28
  year, week, _ = today.isocalendar()
@@ -30,6 +44,7 @@ year, week, _ = today.isocalendar()
30
  DATASET_REPO_URL = (
31
  "https://huggingface.co/datasets/huggingface/transformers-stats-space-data"
32
  )
 
33
  DATA_FILENAME = f"data_{week}_{year}.csv"
34
  DATA_FILE = os.path.join("data", DATA_FILENAME)
35
 
@@ -65,9 +80,12 @@ def retrieve_model_stats():
65
  [m.downloads for m in models if hasattr(m, "downloads")]
66
  )
67
  if len(models) > 0:
68
- model_stats["download_per_model"] = round(
69
- model_stats["num_downloads"] / len(models), 2
70
  )
 
 
 
71
  total_downloads += model_stats["num_downloads"]
72
 
73
  # save in overall dict
@@ -106,7 +124,6 @@ if not os.path.isfile(DATA_FILE):
106
  with open(DATA_FILE, "r") as f:
107
  dataframe = pd.read_csv(DATA_FILE)
108
 
109
- dataframe[dataframe["modality"] == "audio"]
110
  int_downloads = np.array(
111
  [int(x.replace(",", "")) for x in dataframe["num_downloads"].values]
112
  )
@@ -198,7 +215,7 @@ st.title("All stats last 30 days")
198
  st.table(dataframe)
199
 
200
  st.title("Vision stats last 30 days")
201
- st.table(dataframe[dataframe["modality"] == "vision"])
202
 
203
  st.title("Audio stats last 30 days")
204
- st.table(dataframe[dataframe["modality"] == "audio"])
 
11
  from transformers.models.auto.modeling_auto import (
12
  MODEL_FOR_CTC_MAPPING_NAMES,
13
  MODEL_FOR_AUDIO_CLASSIFICATION_MAPPING_NAMES,
14
+ MODEL_FOR_AUDIO_FRAME_CLASSIFICATION_MAPPING_NAMES,
15
+ MODEL_FOR_AUDIO_XVECTOR_MAPPING_NAMES,
16
  MODEL_FOR_SPEECH_SEQ_2_SEQ_MAPPING_NAMES,
17
  MODEL_FOR_VISION_2_SEQ_MAPPING_NAMES,
18
  MODEL_FOR_INSTANCE_SEGMENTATION_MAPPING_NAMES,
 
20
  MODEL_FOR_IMAGE_CLASSIFICATION_MAPPING_NAMES,
21
  MODEL_FOR_CAUSAL_IMAGE_MODELING_MAPPING_NAMES,
22
  MODEL_FOR_MASKED_IMAGE_MODELING_MAPPING_NAMES,
23
+ MODEL_FOR_TABLE_QUESTION_ANSWERING_MAPPING_NAMES,
24
+ MODEL_FOR_VISUAL_QUESTION_ANSWERING_MAPPING_NAMES,
25
+ MODEL_FOR_DOCUMENT_QUESTION_ANSWERING_MAPPING_NAMES,
26
+ MODEL_FOR_BACKBONE_MAPPING_NAMES,
27
+ _MODEL_FOR_ZERO_SHOT_IMAGE_CLASSIFICATION_MAPPING_NAMES,
28
  )
29
 
30
+ audio_models = list(MODEL_FOR_CTC_MAPPING_NAMES.keys()) + list(MODEL_FOR_AUDIO_CLASSIFICATION_MAPPING_NAMES.keys()) + \
31
+ list(MODEL_FOR_SPEECH_SEQ_2_SEQ_MAPPING_NAMES.keys()) + list(MODEL_FOR_AUDIO_FRAME_CLASSIFICATION_MAPPING_NAMES.keys()) + \
32
+ list(MODEL_FOR_AUDIO_XVECTOR_MAPPING_NAMES.keys())
33
 
34
+ vision_models = list(MODEL_FOR_VISION_2_SEQ_MAPPING_NAMES.keys()) + list(MODEL_FOR_INSTANCE_SEGMENTATION_MAPPING_NAMES.keys()) + \
35
+ list(MODEL_FOR_SEMANTIC_SEGMENTATION_MAPPING_NAMES.keys()) + list(MODEL_FOR_IMAGE_CLASSIFICATION_MAPPING_NAMES.keys()) + \
36
+ list(MODEL_FOR_CAUSAL_IMAGE_MODELING_MAPPING_NAMES.keys()) + list(MODEL_FOR_MASKED_IMAGE_MODELING_MAPPING_NAMES.keys()) + \
37
+ list(MODEL_FOR_TABLE_QUESTION_ANSWERING_MAPPING_NAMES.keys()) + list(MODEL_FOR_VISUAL_QUESTION_ANSWERING_MAPPING_NAMES.keys()) + \
38
+ list(MODEL_FOR_DOCUMENT_QUESTION_ANSWERING_MAPPING_NAMES.keys()) + list(MODEL_FOR_BACKBONE_MAPPING_NAMES.keys()) + \
39
+ list(_MODEL_FOR_ZERO_SHOT_IMAGE_CLASSIFICATION_MAPPING_NAMES.keys())
40
 
41
  today = datetime.date.today()
42
  year, week, _ = today.isocalendar()
 
44
  DATASET_REPO_URL = (
45
  "https://huggingface.co/datasets/huggingface/transformers-stats-space-data"
46
  )
47
+
48
  DATA_FILENAME = f"data_{week}_{year}.csv"
49
  DATA_FILE = os.path.join("data", DATA_FILENAME)
50
 
 
80
  [m.downloads for m in models if hasattr(m, "downloads")]
81
  )
82
  if len(models) > 0:
83
+ model_stats["download_per_model"] = int(
84
+ model_stats["num_downloads"] / len(models)
85
  )
86
+ else:
87
+ model_stats["download_per_model"] = model_stats["num_downloads"]
88
+
89
  total_downloads += model_stats["num_downloads"]
90
 
91
  # save in overall dict
 
124
  with open(DATA_FILE, "r") as f:
125
  dataframe = pd.read_csv(DATA_FILE)
126
 
 
127
  int_downloads = np.array(
128
  [int(x.replace(",", "")) for x in dataframe["num_downloads"].values]
129
  )
 
215
  st.table(dataframe)
216
 
217
  st.title("Vision stats last 30 days")
218
+ st.table(dataframe[dataframe["modality"] == "vision"].drop("modality", axis=1))
219
 
220
  st.title("Audio stats last 30 days")
221
+ st.table(dataframe[dataframe["modality"] == "audio"].drop("modality", axis=1))
requirements.txt CHANGED
@@ -1,2 +1,2 @@
1
- transformers>=4.24.0
2
  huggingface_hub
 
1
+ git+https://github.com/huggingface/transformers.git
2
  huggingface_hub