zhaohaipeng 2 месяцев назад
Родитель
Сommit
23b31d8146
2 измененных файлов с 29 добавлено и 23 удалено
  1. 25 0
      script/dnn_model_warm_up.py
  2. 4 23
      script/fish_reference_audio_sync.py

+ 25 - 0
script/dnn_model_warm_up.py

@@ -0,0 +1,25 @@
+#!/usr/bin/env python
+import json
+
+from eas_prediction import TFRequest
+
+shape = 5
+if __name__ == '__main__':
+    fg_config = {}
+    with open("/Users/zhao/Downloads/feature_list_20260417.json", "r") as f:
+        fg_config = json.load(f)
+
+    req = TFRequest('serving_default')
+
+    for feature_info in fg_config['features']:
+        feature_name = feature_info['feature_name']
+        value_type = feature_info['value_type']
+        if value_type == 'Double':
+            req.add_feed(feature_name, [shape], TFRequest.DT_DOUBLE, [0.0] * shape)
+        else:
+            req.add_feed(feature_name, [shape], TFRequest.DT_STRING, [b"-1024"] * shape)
+
+    req.add_fetch('probs_is_share')
+
+    with open("/Users/zhao/Desktop/warm_up_20260417.bin", "wb") as fw:
+        fw.write(req.to_string())

+ 4 - 23
script/fish_reference_audio_sync.py

@@ -19,26 +19,6 @@ mysql_helper = MySQLHelper(
 webhook_url = "https://open.feishu.cn/open-apis/bot/v2/hook/c09712a8-22cd-4bfa-93a5-30ae7b1db11b"
 webhook_url = "https://open.feishu.cn/open-apis/bot/v2/hook/c09712a8-22cd-4bfa-93a5-30ae7b1db11b"
 
 
 
 
-def df_to_feishu_table(df: pd.DataFrame) -> dict:
-    """
-    将 pandas DataFrame 转换为飞书卡片表格组件
-    """
-    # 构建列定义
-    columns = [{"name": col, "width": "auto"} for col in df.columns]
-
-    # 构建行数据
-    rows = []
-    for _, row in df.iterrows():
-        cells = [{"text": str(val)} for val in row.values]
-        rows.append({"cells": cells})
-
-    return {
-        "tag": "table",
-        "columns": columns,
-        "rows": rows
-    }
-
-
 def get_fish_pq_ip() -> List[str]:
 def get_fish_pq_ip() -> List[str]:
     sql = "select * from base_config where config_key = 'fish_pq_ip_list';"
     sql = "select * from base_config where config_key = 'fish_pq_ip_list';"
     result = mysql_helper.execute_query(sql)
     result = mysql_helper.execute_query(sql)
@@ -54,6 +34,7 @@ def get_all_reference_by_db() -> List[Dict[str, Any]]:
 
 
 
 
 def build_card_json(msg: str):
 def build_card_json(msg: str):
+    is_success = True if msg else False
     return {
     return {
         "config": {},
         "config": {},
         "i18n_elements": {
         "i18n_elements": {
@@ -66,7 +47,7 @@ def build_card_json(msg: str):
                 },
                 },
                 {
                 {
                     "tag": "markdown",
                     "tag": "markdown",
-                    "content": f"```\n{msg}\n```" if msg else "全部同步成功",
+                    "content": f"```\n{msg}\n```" if is_success else "全部同步成功",
                     "text_align": "left",
                     "text_align": "left",
                     "text_size": "normal"
                     "text_size": "normal"
                 }
                 }
@@ -76,13 +57,13 @@ def build_card_json(msg: str):
             "zh_cn": {
             "zh_cn": {
                 "title": {
                 "title": {
                     "tag": "plain_text",
                     "tag": "plain_text",
-                    "content": "Fish音频同步失败通知"
+                    "content": "Fish音频同步完成通知"
                 },
                 },
                 "subtitle": {
                 "subtitle": {
                     "tag": "plain_text",
                     "tag": "plain_text",
                     "content": ""
                     "content": ""
                 },
                 },
-                "template": "yellow"
+                "template": "green" if True else "yellow"
             }
             }
         }
         }
     }
     }