Browse Source

测试GPU性能

罗俊辉 9 months ago
parent
commit
b07a05442b

+ 1 - 1
alg.toml

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

+ 5 - 1
applications/config.py

@@ -2,4 +2,8 @@
 @author: luojunhui
 """
 # 默认数据库表
-db_config = ""
+db_config = ""
+
+port = "6062"
+
+ip = "localhost"

+ 3 - 1
applications/functions/article_account.py

@@ -5,12 +5,14 @@ import json
 
 import requests
 
+from applications.config import port
+
 
 class ArticleRank(object):
     """
     账号排序
     """
-    url = "http://localhost:6060/score_list"
+    url = "http://localhost:{}/score_list".format(port)
 
     @classmethod
     def rank(cls, account_list, text_list):

+ 2 - 1
applications/pipeline.py

@@ -6,6 +6,7 @@ import time
 import requests
 
 from applications.functions import title_sim_v2_by_list, is_bad
+from applications.config import port
 
 
 class LongArticlesPipeline(object):
@@ -22,7 +23,7 @@ class LongArticlesPipeline(object):
         print("开始请求")
         print(account_name)
         print(index_list)
-        url = "http://localhost:6060/title_list"
+        url = "http://localhost:{}/title_list".format(port)
         response = requests.request(
             "POST",
             url=url,

+ 2 - 1
routes/accountServer.py

@@ -5,6 +5,7 @@ import json
 
 import aiohttp
 from applications.articleTools import ArticleDBTools
+from applications.config import port
 
 
 class AccountServer(object):
@@ -28,7 +29,7 @@ class AccountServer(object):
         nlp process
         """
         headers = {"Content-Type": "application/json"}
-        url = "http://localhost:6060/nlp"
+        url = "http://localhost:{}/nlp".format(port)
         body = {
             "data": {
                 "text_list_a": [i.replace("'", "") for i in title_list],

+ 3 - 1
test/article_list.py

@@ -3,7 +3,9 @@
 """
 import requests
 
-url = "http://localhost:6060/title_list"
+from applications.config import port
+
+url = "http://localhost:{}/title_list".format(port)
 
 response = requests.request(
     "POST",