suriya7 commited on
Commit
0eb573f
·
verified ·
1 Parent(s): 29cef18

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +12 -12
app.py CHANGED
@@ -18,21 +18,21 @@ model = Xception()
18
  # Restructure model
19
  model = Model(inputs = model.inputs , outputs = model.layers[-2].output)
20
 
21
- import tensorflow as tf
22
 
23
- class MyEmbedding(tf.keras.layers.Embedding):
24
- def __init__(self, *args, input_length=None, **kwargs):
25
- super().__init__(*args, **kwargs)
26
- self.input_length = input_length
27
 
28
- def from_config(cls, config):
29
- input_length = config.pop('input_length', None)
30
- instance = cls(**config)
31
- instance.input_length = input_length
32
- return instance
33
 
34
- # Load the model with custom objects
35
- caption_model = tf.keras.models.load_model('model.h5', custom_objects={'MyEmbedding': MyEmbedding})
36
 
37
 
38
  with open('captions.txt', 'r') as f:
 
18
  # Restructure model
19
  model = Model(inputs = model.inputs , outputs = model.layers[-2].output)
20
 
21
+ # import tensorflow as tf
22
 
23
+ # class MyEmbedding(tf.keras.layers.Embedding):
24
+ # def __init__(self, *args, input_length=None, **kwargs):
25
+ # super().__init__(*args, **kwargs)
26
+ # self.input_length = input_length
27
 
28
+ # def from_config(cls, config):
29
+ # input_length = config.pop('input_length', None)
30
+ # instance = cls(**config)
31
+ # instance.input_length = input_length
32
+ # return instance
33
 
34
+ # # Load the model with custom objects
35
+ # caption_model = tf.keras.models.load_model('model.h5', custom_objects={'MyEmbedding': MyEmbedding})
36
 
37
 
38
  with open('captions.txt', 'r') as f: