Commit 52d1ba5c authored by 赵威's avatar 赵威

test api

parent 4361ceba
......@@ -4,7 +4,6 @@ import traceback
import faiss
import numpy as np
import pandas as pd
from gm_rpcd.all import bind
from utils.cache import redis_client_db
from utils.message import send_msg_to_dingtalk
......@@ -17,11 +16,16 @@ FAISS_TAGS_INDEX = faiss.read_index(INDEX_PATH)
TAG_EMBEDDING_DICT = redis_client_db.hgetall("personas_tags_embedding")
@bind("strategy_embedding/personas_vector/hello")
def hello():
return ["hello", "world"]
@bind("strategy_embedding/personas_vector/match")
def match_tractate_by_device(device_id, n=10):
try:
business_tags = get_user_portrait_tag3_from_redis(device_id, tags_num=5).get("business_tags", [])
business_tags = ["假体下巴", "你好", "假体隆胸"]
# business_tags = ["假体下巴", "你好", "假体隆胸"]
res = []
vectors = []
for tag in business_tags:
......
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