瀏覽代碼

测试GPU性能

罗俊辉 10 月之前
父節點
當前提交
715610ee8d
共有 5 個文件被更改,包括 8 次插入6 次删除
  1. 1 1
      alg.toml
  2. 1 1
      applications/pipeline.py
  3. 2 1
      routes/__init__.py
  4. 3 2
      test/article_list.py
  5. 1 1
      test/rank_dev.py

+ 1 - 1
alg.toml

@@ -1,6 +1,6 @@
 reload = true
 bind = "0.0.0.0:6060"
-workers = 1
+workers = 4
 keep_alive_timeout = 120  # 保持连接的最大秒数,根据需要调整
 graceful_timeout = 30    # 重启或停止之前等待当前工作完成的时间
 loglevel = "debug"  # 日志级别

+ 1 - 1
applications/pipeline.py

@@ -22,7 +22,7 @@ class LongArticlesPipeline(object):
         print("开始请求")
         print(account_name)
         print(index_list)
-        url = "http://47.98.154.124:6060/title_list"
+        url = "http://localhost:6060/title_list"
         response = requests.request(
             "POST",
             url=url,

+ 2 - 1
routes/__init__.py

@@ -68,6 +68,7 @@ def AlgRoutes(mysql_client, model):
         :return:
         """
         params = await request.get_json()
+        print(params)
         ADBT = ArticleDBTools(mysql_client=mysql_client)
         responseDF = await ADBT.getArticleByFilter(
             account_name=params['account_name'],
@@ -78,7 +79,7 @@ def AlgRoutes(mysql_client, model):
 
         )
         title_list = responseDF['title']
-        response = {"title_list": title_list.values.tolist()}
+        response = {"title_list": title_list.values.tolist()[-20:]}
         return jsonify(response)
 
     @blueprint.route("/article_crawler", methods=["POST"])

+ 3 - 2
test/article_list.py

@@ -3,7 +3,7 @@
 """
 import requests
 
-url = "http://47.98.154.124:6060/title_list"
+url = "http://localhost:6060/title_list"
 
 response = requests.request(
     "POST",
@@ -17,4 +17,5 @@ response = requests.request(
         "msg_type": "9"
     }
 )
-print(response.json())
+print(response.json())
+print(len(response.json()['title_list']))

文件差異過大導致無法顯示
+ 1 - 1
test/rank_dev.py


部分文件因文件數量過多而無法顯示