Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -9,18 +9,10 @@ from official.nlp.data import classifier_data_lib
|
|
9 |
from official.nlp.bert import tokenization
|
10 |
from official.nlp import optimization
|
11 |
tf.get_logger().setLevel('ERROR')
|
12 |
-
|
13 |
import math
|
14 |
from datetime import datetime
|
15 |
-
|
16 |
import gradio as gr
|
17 |
|
18 |
-
import socket
|
19 |
-
hostname = socket.gethostname()
|
20 |
-
ip_address = socket.gethostbyname(hostname)
|
21 |
-
print(f"Hostname: {hostname}")
|
22 |
-
print(f"IP Address: {ip_address}")
|
23 |
-
|
24 |
|
25 |
config = tf.compat.v1.ConfigProto(
|
26 |
device_count = {'cpu': 0}
|
@@ -38,16 +30,12 @@ optimizer = optimization.create_optimizer(init_lr=init_lr,
|
|
38 |
checkpoint_filepath=r'./Checkpoint'
|
39 |
model = tf.keras.models.load_model(checkpoint_filepath, custom_objects={'KerasLayer':hub.KerasLayer , 'AdamWeightDecay': optimizer})
|
40 |
|
41 |
-
|
42 |
-
|
43 |
df_report = pd.read_csv('./CTH_Description.csv')
|
44 |
df_report['CTH Code'] = df_report['CTH Code'].astype(str).str.zfill(8)
|
45 |
|
46 |
df_report_DUTY = pd.read_csv('./CTH_WISE_DUTY_RATE.csv')
|
47 |
df_report_DUTY['CTH'] = df_report_DUTY['CTH'].astype(str).str.zfill(8)
|
48 |
|
49 |
-
#print(df_report_DUTY)
|
50 |
-
|
51 |
df = pd.read_csv("./CTH_CODE_MAP.csv")
|
52 |
df['CTH'] = df['CTH'].astype(str).str.zfill(8)
|
53 |
df = df[['CTH', 'code']]
|
|
|
9 |
from official.nlp.bert import tokenization
|
10 |
from official.nlp import optimization
|
11 |
tf.get_logger().setLevel('ERROR')
|
|
|
12 |
import math
|
13 |
from datetime import datetime
|
|
|
14 |
import gradio as gr
|
15 |
|
|
|
|
|
|
|
|
|
|
|
|
|
16 |
|
17 |
config = tf.compat.v1.ConfigProto(
|
18 |
device_count = {'cpu': 0}
|
|
|
30 |
checkpoint_filepath=r'./Checkpoint'
|
31 |
model = tf.keras.models.load_model(checkpoint_filepath, custom_objects={'KerasLayer':hub.KerasLayer , 'AdamWeightDecay': optimizer})
|
32 |
|
|
|
|
|
33 |
df_report = pd.read_csv('./CTH_Description.csv')
|
34 |
df_report['CTH Code'] = df_report['CTH Code'].astype(str).str.zfill(8)
|
35 |
|
36 |
df_report_DUTY = pd.read_csv('./CTH_WISE_DUTY_RATE.csv')
|
37 |
df_report_DUTY['CTH'] = df_report_DUTY['CTH'].astype(str).str.zfill(8)
|
38 |
|
|
|
|
|
39 |
df = pd.read_csv("./CTH_CODE_MAP.csv")
|
40 |
df['CTH'] = df['CTH'].astype(str).str.zfill(8)
|
41 |
df = df[['CTH', 'code']]
|