Antonio
commited on
Commit
·
7eb4ab1
1
Parent(s):
5a8dd6a
Changed path to models
Browse files
app.py
CHANGED
@@ -182,13 +182,13 @@ decision_frameworks = {
|
|
182 |
def predict(video_file, video_model_name, audio_model_name, framework_name):
|
183 |
|
184 |
image_processor = VivitImageProcessor.from_pretrained("google/vivit-b-16x2-kinetics400")
|
185 |
-
video_model = torch.load(video_model_name)
|
186 |
|
187 |
model_id = "facebook/wav2vec2-large"
|
188 |
config = AutoConfig.from_pretrained(model_id, num_labels=6)
|
189 |
audio_processor = AutoFeatureExtractor.from_pretrained(model_id)
|
190 |
audio_model = Wav2Vec2ForSequenceClassification.from_pretrained(model_id, config=config)
|
191 |
-
audio_model.load_state_dict(torch.load(audio_model_name))
|
192 |
audio_model.eval()
|
193 |
|
194 |
delete_directory_path = "./temp/"
|
|
|
182 |
def predict(video_file, video_model_name, audio_model_name, framework_name):
|
183 |
|
184 |
image_processor = VivitImageProcessor.from_pretrained("google/vivit-b-16x2-kinetics400")
|
185 |
+
video_model = torch.load('./' + video_model_name)
|
186 |
|
187 |
model_id = "facebook/wav2vec2-large"
|
188 |
config = AutoConfig.from_pretrained(model_id, num_labels=6)
|
189 |
audio_processor = AutoFeatureExtractor.from_pretrained(model_id)
|
190 |
audio_model = Wav2Vec2ForSequenceClassification.from_pretrained(model_id, config=config)
|
191 |
+
audio_model.load_state_dict(torch.load('./' + audio_model_name))
|
192 |
audio_model.eval()
|
193 |
|
194 |
delete_directory_path = "./temp/"
|