liqian 3 年之前
父節點
當前提交
089def35ab
共有 2 個文件被更改,包括 6 次插入5 次删除
  1. 2 2
      config.py
  2. 4 3
      video_recall.py

+ 2 - 2
config.py

@@ -167,6 +167,6 @@ class ProductionConfig(BaseConfig):
 
 def set_config():
     # return DevelopmentConfig()
-    # return TestConfig()
+    return TestConfig()
     # return PreProductionConfig()
-    return ProductionConfig()
+    # return ProductionConfig()

+ 4 - 3
video_recall.py

@@ -60,8 +60,9 @@ class PoolRecall(object):
             video_ids = []
             video_score = {}
             for value in data:
-                video_ids.append(eval(value[0]))
-                video_score[eval(value[0])] = value[1]
+                video_id = int(value[0])
+                video_ids.append(video_id)
+                video_score[video_id] = value[1]
             # 过滤
             debug_tm_b = time.time()
             filter_ = FilterVideos(app_type=self.app_type, mid=self.mid, uid=self.uid, video_ids=video_ids)
@@ -139,7 +140,7 @@ class PoolRecall(object):
                         # 取其中一个 flow_pool 作为召回结果
                         # 添加视频源参数 pushFrom, abCode
                         flow_pool_recall_result.append(
-                            {'videoId': item[0], 'flowPool': item[1],
+                            {'videoId': int(item[0]), 'flowPool': item[1],
                              'rovScore': video_score[item[0]], 'pushFrom': 'flow_pool', 'abCode': self.ab_code}
                         )
                         # flow_pool_recall_result.append(