geninhu commited on
Commit
06846a6
·
1 Parent(s): 0b049cf

Upload app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -2
app.py CHANGED
@@ -2,13 +2,14 @@ import math
2
  import numpy as np
3
  import pandas as pd
4
  import tensorflow as tf
 
5
  from tensorflow import keras
6
  from tensorflow.keras import layers
7
 
8
  import gradio as gr
9
  from huggingface_hub import from_pretrained_keras
10
 
11
- model = from_pretrained_keras('keras-io/tab_transformer')
12
 
13
  def get_dataset_from_pandas(data):
14
  for col in data.columns:
@@ -87,4 +88,4 @@ examples = [[39.0, ' Private', ' Assoc-voc', 11.0, ' Divorced', ' Tech-support',
87
  [30.0, ' Private', ' Masters', 14.0, ' Never-married', ' Prof-specialty', ' Not-in-family', ' Asian-Pac-Islander', ' Male', 0.0, 0.0, 45.0, ' Iran']]
88
 
89
  gr.Interface(infer, inputs, output, examples= examples, allow_flagging='never',
90
- title=title, description=description, article=article, live=False).launch(enable_queue=True, debug=False)
 
2
  import numpy as np
3
  import pandas as pd
4
  import tensorflow as tf
5
+ import tensorflow_addons as tfa
6
  from tensorflow import keras
7
  from tensorflow.keras import layers
8
 
9
  import gradio as gr
10
  from huggingface_hub import from_pretrained_keras
11
 
12
+ model = from_pretrained_keras('keras-io/tab_transformer', custom_objects={'optimizer': tfa.optimizers.AdamW})
13
 
14
  def get_dataset_from_pandas(data):
15
  for col in data.columns:
 
88
  [30.0, ' Private', ' Masters', 14.0, ' Never-married', ' Prof-specialty', ' Not-in-family', ' Asian-Pac-Islander', ' Male', 0.0, 0.0, 45.0, ' Iran']]
89
 
90
  gr.Interface(infer, inputs, output, examples= examples, allow_flagging='never',
91
+ title=title, description=description, article=article, live=False).launch(enable_queue=True, debug=True, inbrowser=True)