netgvarun2005 commited on
Commit
dde5225
·
1 Parent(s): b11ea2e

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +26 -117
README.md CHANGED
@@ -43,6 +43,8 @@ Model can accurately recognize emotions classes- Angry,Sad,Fearful,Happy,Disgust
43
  Emotions recognized - Angry,Sad,Fearful,Happy,Disgusted,Surprised,Calm with ~80% accuracy.
44
 
45
  Use the code below to get started with the model:
 
 
46
  class MultimodalModel(nn.Module):
47
  '''
48
  Custom PyTorch model that takes as input both the audio features and the text embeddings, and concatenates the last hidden states from the Hubert and BERT models.
@@ -66,131 +68,38 @@ class MultimodalModel(nn.Module):
66
  logits = self.classifier(concat_output)
67
  return logits
68
 
69
- [More Information Needed]
70
-
71
- ## Training Details
72
-
73
- ### Training Data
74
-
75
- <!-- This should link to a Dataset Card, perhaps with a short stub of information on what the training data is all about as well as documentation related to data pre-processing or additional filtering. -->
76
-
77
- [More Information Needed]
78
-
79
- ### Training Procedure
80
-
81
- <!-- This relates heavily to the Technical Specifications. Content here should link to that section when it is relevant to the training procedure. -->
82
-
83
- #### Preprocessing [optional]
84
-
85
- [More Information Needed]
86
-
87
-
88
- #### Training Hyperparameters
89
-
90
- - **Training regime:** [More Information Needed] <!--fp32, fp16 mixed precision, bf16 mixed precision, bf16 non-mixed precision, fp16 non-mixed precision, fp8 mixed precision -->
91
-
92
- #### Speeds, Sizes, Times [optional]
93
-
94
- <!-- This section provides information about throughput, start/end time, checkpoint size if relevant, etc. -->
95
-
96
- [More Information Needed]
97
-
98
- ## Evaluation
99
-
100
- <!-- This section describes the evaluation protocols and provides the results. -->
101
-
102
- ### Testing Data, Factors & Metrics
103
-
104
- #### Testing Data
105
-
106
- <!-- This should link to a Dataset Card if possible. -->
107
-
108
- [More Information Needed]
109
-
110
- #### Factors
111
-
112
- <!-- These are the things the evaluation is disaggregating by, e.g., subpopulations or domains. -->
113
-
114
- [More Information Needed]
115
-
116
- #### Metrics
117
-
118
- <!-- These are the evaluation metrics being used, ideally with a description of why. -->
119
-
120
- [More Information Needed]
121
-
122
- ### Results
123
-
124
- [More Information Needed]
125
-
126
- #### Summary
127
-
128
-
129
-
130
- ## Model Examination [optional]
131
-
132
- <!-- Relevant interpretability work for the model goes here -->
133
-
134
- [More Information Needed]
135
-
136
- ## Environmental Impact
137
-
138
- <!-- Total emissions (in grams of CO2eq) and additional considerations, such as electricity usage, go here. Edit the suggested text below accordingly -->
139
-
140
- Carbon emissions can be estimated using the [Machine Learning Impact calculator](https://mlco2.github.io/impact#compute) presented in [Lacoste et al. (2019)](https://arxiv.org/abs/1910.09700).
141
-
142
- - **Hardware Type:** [More Information Needed]
143
- - **Hours used:** [More Information Needed]
144
- - **Cloud Provider:** [More Information Needed]
145
- - **Compute Region:** [More Information Needed]
146
- - **Carbon Emitted:** [More Information Needed]
147
-
148
- ## Technical Specifications [optional]
149
-
150
- ### Model Architecture and Objective
151
-
152
- [More Information Needed]
153
-
154
- ### Compute Infrastructure
155
-
156
- [More Information Needed]
157
-
158
- #### Hardware
159
-
160
- [More Information Needed]
161
-
162
- #### Software
163
-
164
- [More Information Needed]
165
-
166
- ## Citation [optional]
167
-
168
- <!-- If there is a paper or blog post introducing the model, the APA and Bibtex information for that should go in this section. -->
169
-
170
- **BibTeX:**
171
-
172
- [More Information Needed]
173
-
174
- **APA:**
175
-
176
- [More Information Needed]
177
 
178
- ## Glossary [optional]
 
 
179
 
180
- <!-- If relevant, include terms and calculations in this section that can help readers understand the model or model card. -->
 
 
181
 
182
- [More Information Needed]
 
 
 
 
 
 
 
 
183
 
184
- ## More Information [optional]
 
 
185
 
186
- [More Information Needed]
 
 
 
 
187
 
188
- ## Model Card Authors [optional]
189
 
190
- [More Information Needed]
191
 
192
- ## Model Card Contact
193
 
194
- [More Information Needed]
195
 
196
 
 
43
  Emotions recognized - Angry,Sad,Fearful,Happy,Disgusted,Surprised,Calm with ~80% accuracy.
44
 
45
  Use the code below to get started with the model:
46
+
47
+
48
  class MultimodalModel(nn.Module):
49
  '''
50
  Custom PyTorch model that takes as input both the audio features and the text embeddings, and concatenates the last hidden states from the Hubert and BERT models.
 
68
  logits = self.classifier(concat_output)
69
  return logits
70
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
71
 
72
+ def load_model():
73
+ """
74
+ Load and configure various models and tokenizers for a multi-modal application.
75
 
76
+ This function loads a multi-modal model and its weights from a specified source,
77
+ initializes tokenizers for the model and an additional language model, and returns
78
+ these components for use in a multi-modal application.
79
 
80
+ Returns:
81
+ tuple: A tuple containing the following components:
82
+ - multiModel (MultimodalModel): The multi-modal model.
83
+ - tokenizer (AutoTokenizer): Tokenizer for the multi-modal model.
84
+ - model_gpt (AutoModelForCausalLM): Language model for text generation.
85
+ - tokenizer_gpt (AutoTokenizer): Tokenizer for the language model.
86
+ """
87
+ # Load the model
88
+ multiModel = MultimodalModel(bert_model_name, num_labels)
89
 
90
+ # Load the model weights and tokenizer directly from Hugging Face Spaces
91
+ multiModel.load_state_dict(torch.hub.load_state_dict_from_url(model_weights_path, map_location=device), strict=False)
92
+ tokenizer = AutoTokenizer.from_pretrained("netgvarun2005/MultiModalBertHubertTokenizer")
93
 
94
+ # GenAI
95
+ tokenizer_gpt = AutoTokenizer.from_pretrained("netgvarun2005/GPTTherapistDeepSpeedTokenizer", pad_token='<|pad|>',bos_token='<|startoftext|>',eos_token='<|endoftext|>')
96
+ model_gpt = AutoModelForCausalLM.from_pretrained("netgvarun2005/GPTTherapistDeepSpeedModel")
97
+
98
+ return multiModel,tokenizer,model_gpt,tokenizer_gpt
99
 
 
100
 
 
101
 
 
102
 
103
+ ## Model Card Authors [Varun Sharma]
104
 
105