Commit 940718ac authored by 郭羽's avatar 郭羽

service model 优化

parent ac8f177a
......@@ -881,8 +881,7 @@ if __name__ == '__main__':
# model columns
print("model columns to redis...")
model_columns = user_columns + item_columns
not_model_columns = [col for col in model_columns if not col.endswith("_number")]
featureColumnsToRedis(not_model_columns)
featureColumnsToRedis(model_columns)
print("数据字典save...")
print("dataVocab:", str(dataVocab.keys()))
......
......@@ -197,7 +197,7 @@ def test(df_train):
# pre_data = pre_data.replace("'",'"')
print(pre_data)
timestmp1 = int(round(time.time()*1000))
r = requests.post('http://10.27.248.223:80/v1/models/service:predict', data=pre_data)
r = requests.post('http://tensorserving:80/v1/models/service:predict', data=pre_data)
print("测试样本数:{},测试耗时ms:{}".format(10,int(round(time.time()*1000))- timestmp1))
if __name__ == '__main__':
......
......@@ -83,10 +83,10 @@ def getTrainColumns(train_columns,data_vocab):
emb_columns.append(col)
inputs[feature] = tf.keras.layers.Input(name=feature, shape=(), dtype='string')
# elif feature.endswith("_number"):
# col = tf.feature_column.numeric_column(feature)
# number_columns.append(col)
# inputs[feature] = tf.keras.layers.Input(name=feature, shape=(), dtype='float32')
elif feature.endswith("_number"):
col = tf.feature_column.numeric_column(feature)
number_columns.append(col)
inputs[feature] = tf.keras.layers.Input(name=feature, shape=(), dtype='float32')
return emb_columns,number_columns,inputs
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment