innat commited on
Commit
1ae4494
1 Parent(s): d2b5ae1

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +11 -2
app.py CHANGED
@@ -1,3 +1,4 @@
 
1
  import gradio as gr
2
  import numpy as np
3
  import imageio
@@ -52,8 +53,16 @@ def tube_mask_generator(mask_ratio):
52
  def get_model(model_type):
53
  print('---------------------')
54
  print('innat/videomae/' + model_type + '_FT')
55
- ft_model = keras.models.load_model('innat/videomae/' + model_type + '_FT')
56
- pt_model = keras.models.load_model('innat/videomae/' + model_type + '_PT')
 
 
 
 
 
 
 
 
57
 
58
  if 'K400' in model_type:
59
  data_type = 'K400'
 
1
+ from huggingface_hub import hf_hub_download
2
  import gradio as gr
3
  import numpy as np
4
  import imageio
 
53
  def get_model(model_type):
54
  print('---------------------')
55
  print('innat/videomae/' + model_type + '_FT')
56
+
57
+ ft_path = hf_hub_download(
58
+ repo_id=hf_dataset_identifier, filename='innat/videomae/' + model_type + '_FT', repo_type="model"
59
+ )
60
+ pt_path = hf_hub_download(
61
+ repo_id=hf_dataset_identifier, filename='innat/videomae/' + model_type + '_PT', repo_type="model"
62
+ )
63
+
64
+ ft_model = keras.models.load_model(ft_path)
65
+ pt_model = keras.models.load_model(pt_path)
66
 
67
  if 'K400' in model_type:
68
  data_type = 'K400'