From 0017568cc7de6b740b76ba57c26260ac7b6ac771 Mon Sep 17 00:00:00 2001 From: xupei Date: Mon, 17 Jun 2024 10:21:49 +0800 Subject: [PATCH 1/8] slogan --- .../da/common/RabbitMQ/GenerateConsumer.java | 2 +- .../com/ai/da/common/RabbitMQ/MQConfig.java | 23 +++++++++++-------- .../ai/da/common/constant/CommonConstant.java | 8 ++++++- .../java/com/ai/da/python/PythonService.java | 8 +++---- .../da/service/impl/GenerateServiceImpl.java | 9 ++++++-- 5 files changed, 33 insertions(+), 17 deletions(-) diff --git a/src/main/java/com/ai/da/common/RabbitMQ/GenerateConsumer.java b/src/main/java/com/ai/da/common/RabbitMQ/GenerateConsumer.java index d201a3ee..14c8cae5 100644 --- a/src/main/java/com/ai/da/common/RabbitMQ/GenerateConsumer.java +++ b/src/main/java/com/ai/da/common/RabbitMQ/GenerateConsumer.java @@ -72,7 +72,7 @@ public class GenerateConsumer { try { generateService.generateThroughImageText(generateThroughImageTextDTO); }catch (Exception e){ - log.error(e.getMessage()); + log.error("error message : {}", e.getMessage()); } // 将消息从redis排队队列中删除,需保证被消费的消息存储到db之后再从redis删除 redisUtil.removeFromZSet(consumptionOrderKey, uniqueId); diff --git a/src/main/java/com/ai/da/common/RabbitMQ/MQConfig.java b/src/main/java/com/ai/da/common/RabbitMQ/MQConfig.java index 6d9e54ae..40f1d522 100644 --- a/src/main/java/com/ai/da/common/RabbitMQ/MQConfig.java +++ b/src/main/java/com/ai/da/common/RabbitMQ/MQConfig.java @@ -12,18 +12,23 @@ public class MQConfig { // public static final String GENERATE_QUEUE = "generate-queue-test"; // ================================================================== // public static final String GENERATE_QUEUE = "generate-queue-local"; - public static final String GENERATE_QUEUE = "generate-queue-prod"; - + public static final String GENERATE_QUEUE = "generate-queue-dev"; +// public static final String GENERATE_QUEUE = "generate-queue-prod"; +// // public static final String SR_QUEUE = "SR-queue-local"; - public static final String SR_QUEUE = "SR-queue-prod"; - + public static final String SR_QUEUE = "SR-queue-dev"; +// public static final String SR_QUEUE = "SR-queue-prod"; +// // public static final String SR_RESULT_QUEUE = "SuperResolution-local"; - public static final String SR_RESULT_QUEUE = "SuperResolution-prod"; - + public static final String SR_RESULT_QUEUE = "SuperResolution-dev"; +// public static final String SR_RESULT_QUEUE = "SuperResolution-prod"; +// // public static final String GENERATE_RESULT_QUEUE = "GenerateImage-local"; - public static final String GENERATE_RESULT_QUEUE = "GenerateImage-prod"; - - public static final String TO_PRODUCT_IMAGE_RESULT_QUEUE = "ToProductImage-local"; + public static final String GENERATE_RESULT_QUEUE = "GenerateImage-dev"; +// public static final String GENERATE_RESULT_QUEUE = "GenerateImage-prod"; +// +// public static final String TO_PRODUCT_IMAGE_RESULT_QUEUE = "ToProductImage-local"; + public static final String TO_PRODUCT_IMAGE_RESULT_QUEUE = "ToProductImage-dev"; public MQConfig() { } diff --git a/src/main/java/com/ai/da/common/constant/CommonConstant.java b/src/main/java/com/ai/da/common/constant/CommonConstant.java index 0bc1af58..3fbee692 100644 --- a/src/main/java/com/ai/da/common/constant/CommonConstant.java +++ b/src/main/java/com/ai/da/common/constant/CommonConstant.java @@ -21,6 +21,12 @@ public class CommonConstant { public static final String GENERATE_SINGLE_LOGO = "/api/generate_single_logo"; - public static final String GENERATE_SLOGAN = "/api/slogan"; + public static final String GENERATE_SLOGAN = "/apislogan"; + + public static final String PYTHON_PORT_9996 = "9996"; + + public static final String PYTHON_PORT_9997 = "9997"; + + } diff --git a/src/main/java/com/ai/da/python/PythonService.java b/src/main/java/com/ai/da/python/PythonService.java index 37453c05..5a084a06 100644 --- a/src/main/java/com/ai/da/python/PythonService.java +++ b/src/main/java/com/ai/da/python/PythonService.java @@ -2977,7 +2977,7 @@ public class PythonService { throw new BusinessException("system error!"); } - public Boolean generateSketchOrPrint(String params, String servicePath) { + public Boolean generateSketchOrPrint(String params, String port, String servicePath) { //限流校验 // AccessLimitUtils.validate("generateSketchOrPrint", 5); OkHttpClient client = new OkHttpClient().newBuilder() @@ -2994,7 +2994,7 @@ public class PythonService { // .url("http://127.0.0.1:5000/api/diffusion") // .url(accessPythonIp + ":" + accessPythonPort + "/api/diffusion") // .url(accessPythonIp + ":" + accessPythonPort + "/api/generate_image") - .url(fastApiPythonAddress + servicePath) + .url(accessPythonIp + ":" + port + servicePath) .method("POST", body) // .addHeader("Authorization", "Basic YWlkbGFiOjEyMw==") .addHeader("Content-Type", "application/json") @@ -3259,8 +3259,8 @@ public class PythonService { String jsonString = JSON.toJSONString(content, SerializerFeature.WriteNullStringAsEmpty); RequestBody body = RequestBody.create(mediaType, jsonString); Request request = new Request.Builder() - .url(accessPythonIp + ":" + accessPythonPort + "/api/translateToEN") -// .url(fastApiPythonAddress + "/api/translateToEN") +// .url(accessPythonIp + ":" + accessPythonPort + "/api/translateToEN") + .url(fastApiPythonAddress + "/api/translateToEN") .method("POST", body) .addHeader("Content-Type", "application/json") .build(); diff --git a/src/main/java/com/ai/da/service/impl/GenerateServiceImpl.java b/src/main/java/com/ai/da/service/impl/GenerateServiceImpl.java index 0d36ff5d..2b0f40b3 100644 --- a/src/main/java/com/ai/da/service/impl/GenerateServiceImpl.java +++ b/src/main/java/com/ai/da/service/impl/GenerateServiceImpl.java @@ -142,6 +142,7 @@ public class GenerateServiceImpl extends ServiceImpl i String category = generateThroughImageTextDTO.getLevel1Type().equals(SKETCH_BOARD.getRealName()) ? "sketch" : generateThroughImageTextDTO.getLevel1Type().equals(PRINT_BOARD.getRealName()) ? "print" : "moodboard"; String path = CommonConstant.GENERATE_PATH; + String port = CommonConstant.PYTHON_PORT_9996; String jsonString = ""; HashMap params = new HashMap<>(); // 3.1 确定不同类型的印花分别调哪个接口 @@ -156,9 +157,11 @@ public class GenerateServiceImpl extends ServiceImpl i break; case "Slogan": path = CommonConstant.GENERATE_SLOGAN; + port = CommonConstant.PYTHON_PORT_9997; + params.put("num_point","16"); params.put("tasks_id",generateThroughImageTextDTO.getUniqueId()); params.put("prompt", text); - params.put("svg", collectionElement.getUrl()); + params.put("image_url", collectionElement.getUrl()); jsonString = JSON.toJSONString(params, SerializerFeature.WriteMapNullValue); break; case "Pattern": @@ -172,7 +175,7 @@ public class GenerateServiceImpl extends ServiceImpl i jsonString = JSON.toJSONString(generateToPythonDTO, SerializerFeature.WriteMapNullValue); } - Boolean requestResult = pythonService.generateSketchOrPrint(jsonString, path); + Boolean requestResult = pythonService.generateSketchOrPrint(jsonString, port, path); // 4、将请求信息落库,将本次generate的请求信息添加到t_generate表中 save(generate); @@ -524,8 +527,10 @@ public class GenerateServiceImpl extends ServiceImpl i throw new BusinessException("Slogan can not be empty!"); } + times = 1; // 将图片上传到图片服务器 String path = minioUtil.base64UploadToPath(generateThroughImageTextDTO.getSloganBase64(), sloganBucket, null); +// String path = "test/7c9114f93d08a702e00da928e66f321.png"; String name = path.substring(path.lastIndexOf("/") + 1, path.lastIndexOf(".")); // 保存到db,collection-element CollectionElement collectionElement = new CollectionElement(); From b5b6f737aa265351f1a2990935c071444e8e3601 Mon Sep 17 00:00:00 2001 From: xupei Date: Mon, 17 Jun 2024 10:41:36 +0800 Subject: [PATCH 2/8] =?UTF-8?q?slogan=20=E6=9A=82=E5=81=9C=E7=9B=91?= =?UTF-8?q?=E5=90=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/java/com/ai/da/common/RabbitMQ/MQConfig.java | 2 +- src/main/java/com/ai/da/python/PythonService.java | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/ai/da/common/RabbitMQ/MQConfig.java b/src/main/java/com/ai/da/common/RabbitMQ/MQConfig.java index eb0af5cc..c3892a66 100644 --- a/src/main/java/com/ai/da/common/RabbitMQ/MQConfig.java +++ b/src/main/java/com/ai/da/common/RabbitMQ/MQConfig.java @@ -24,7 +24,7 @@ public class MQConfig { // public static final String SR_RESULT_QUEUE = "SuperResolution-prod"; // // public static final String GENERATE_RESULT_QUEUE = "GenerateImage-local"; - public static final String GENERATE_RESULT_QUEUE = "GenerateImage-dev"; +// public static final String GENERATE_RESULT_QUEUE = "GenerateImage-dev"; public static final String TO_PRODUCT_IMAGE_RESULT_QUEUE = "ToProductImage-local"; public MQConfig() { diff --git a/src/main/java/com/ai/da/python/PythonService.java b/src/main/java/com/ai/da/python/PythonService.java index 5a084a06..9ab7c05c 100644 --- a/src/main/java/com/ai/da/python/PythonService.java +++ b/src/main/java/com/ai/da/python/PythonService.java @@ -2989,6 +2989,8 @@ public class PythonService { MediaType mediaType = MediaType.parse("application/json"); // RequestBody body = RequestBody.create(mediaType, JSON.toJSONString(generateToPythonDTO, SerializerFeature.WriteMapNullValue)); RequestBody body = RequestBody.create(mediaType, params); + + log.info("generate 请求地址: {}", accessPythonIp + ":" + port + servicePath); Request request = new Request.Builder() // .url("http://18.167.251.121:9992") // .url("http://127.0.0.1:5000/api/diffusion") From dbd89798d5b7ccc54f6220bfffeacf518fc488b7 Mon Sep 17 00:00:00 2001 From: xupei Date: Mon, 17 Jun 2024 10:42:45 +0800 Subject: [PATCH 3/8] =?UTF-8?q?slogan=20=E6=9A=82=E5=81=9C=E7=9B=91?= =?UTF-8?q?=E5=90=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/java/com/ai/da/common/RabbitMQ/MQConfig.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/ai/da/common/RabbitMQ/MQConfig.java b/src/main/java/com/ai/da/common/RabbitMQ/MQConfig.java index c3892a66..903513ea 100644 --- a/src/main/java/com/ai/da/common/RabbitMQ/MQConfig.java +++ b/src/main/java/com/ai/da/common/RabbitMQ/MQConfig.java @@ -11,8 +11,8 @@ public class MQConfig { // public static final String GENERATE_QUEUE = "generate-queue-prod"; // public static final String GENERATE_QUEUE = "generate-queue-test"; // ================================================================== -// public static final String GENERATE_QUEUE = "generate-queue-local"; - public static final String GENERATE_QUEUE = "generate-queue-dev"; + public static final String GENERATE_QUEUE = "generate-queue-local"; +// public static final String GENERATE_QUEUE = "generate-queue-dev"; // public static final String GENERATE_QUEUE = "generate-queue-prod"; // // public static final String SR_QUEUE = "SR-queue-local"; @@ -23,7 +23,7 @@ public class MQConfig { public static final String SR_RESULT_QUEUE = "SuperResolution-dev"; // public static final String SR_RESULT_QUEUE = "SuperResolution-prod"; // -// public static final String GENERATE_RESULT_QUEUE = "GenerateImage-local"; + public static final String GENERATE_RESULT_QUEUE = "GenerateImage-local"; // public static final String GENERATE_RESULT_QUEUE = "GenerateImage-dev"; public static final String TO_PRODUCT_IMAGE_RESULT_QUEUE = "ToProductImage-local"; From 5e1ff16052c6046bb1bdef3ecb6a26d9d3f44da2 Mon Sep 17 00:00:00 2001 From: xupei Date: Mon, 17 Jun 2024 10:51:35 +0800 Subject: [PATCH 4/8] =?UTF-8?q?slogan=20=E6=9A=82=E5=81=9C=E7=9B=91?= =?UTF-8?q?=E5=90=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/java/com/ai/da/common/RabbitMQ/MQConfig.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main/java/com/ai/da/common/RabbitMQ/MQConfig.java b/src/main/java/com/ai/da/common/RabbitMQ/MQConfig.java index 903513ea..eb0af5cc 100644 --- a/src/main/java/com/ai/da/common/RabbitMQ/MQConfig.java +++ b/src/main/java/com/ai/da/common/RabbitMQ/MQConfig.java @@ -11,8 +11,8 @@ public class MQConfig { // public static final String GENERATE_QUEUE = "generate-queue-prod"; // public static final String GENERATE_QUEUE = "generate-queue-test"; // ================================================================== - public static final String GENERATE_QUEUE = "generate-queue-local"; -// public static final String GENERATE_QUEUE = "generate-queue-dev"; +// public static final String GENERATE_QUEUE = "generate-queue-local"; + public static final String GENERATE_QUEUE = "generate-queue-dev"; // public static final String GENERATE_QUEUE = "generate-queue-prod"; // // public static final String SR_QUEUE = "SR-queue-local"; @@ -23,8 +23,8 @@ public class MQConfig { public static final String SR_RESULT_QUEUE = "SuperResolution-dev"; // public static final String SR_RESULT_QUEUE = "SuperResolution-prod"; // - public static final String GENERATE_RESULT_QUEUE = "GenerateImage-local"; -// public static final String GENERATE_RESULT_QUEUE = "GenerateImage-dev"; +// public static final String GENERATE_RESULT_QUEUE = "GenerateImage-local"; + public static final String GENERATE_RESULT_QUEUE = "GenerateImage-dev"; public static final String TO_PRODUCT_IMAGE_RESULT_QUEUE = "ToProductImage-local"; public MQConfig() { From 8ff8a7480fa7a2eacc5e17a83ca19f491dc0cbe6 Mon Sep 17 00:00:00 2001 From: xupei Date: Mon, 17 Jun 2024 11:21:54 +0800 Subject: [PATCH 5/8] =?UTF-8?q?slogan=20=E6=81=A2=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/java/com/ai/da/python/PythonService.java | 4 +++- .../java/com/ai/da/service/impl/GenerateServiceImpl.java | 6 +++++- src/main/resources/application-dev.properties | 2 +- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/ai/da/python/PythonService.java b/src/main/java/com/ai/da/python/PythonService.java index 9ab7c05c..7eb77e1a 100644 --- a/src/main/java/com/ai/da/python/PythonService.java +++ b/src/main/java/com/ai/da/python/PythonService.java @@ -67,6 +67,8 @@ public class PythonService { private String fastApiPythonAddress; @Value("${minio.bucketName.gradient}") private String gradientBucketName; + @Value("${access.python.generate_sr_port}") + private String srServicePort; @Resource private PythonTAllInfoService pythonTAllInfoService; @@ -3222,7 +3224,7 @@ public class PythonService { String jsonString = JSON.toJSONString(content, SerializerFeature.WriteNullStringAsEmpty); RequestBody body = RequestBody.create(mediaType, jsonString); Request request = new Request.Builder() - .url(fastApiPythonAddress + "/api/super_resolution") + .url(accessPythonIp + srServicePort + "/api/super_resolution") .method("POST", body) .addHeader("Content-Type", "application/json") .build(); diff --git a/src/main/java/com/ai/da/service/impl/GenerateServiceImpl.java b/src/main/java/com/ai/da/service/impl/GenerateServiceImpl.java index fbbb9800..f937235f 100644 --- a/src/main/java/com/ai/da/service/impl/GenerateServiceImpl.java +++ b/src/main/java/com/ai/da/service/impl/GenerateServiceImpl.java @@ -88,6 +88,10 @@ public class GenerateServiceImpl extends ServiceImpl i @Value("${redis.key.toProductImageResultKey}") private String toProductImageResultKey; + @Value("${access.python.generate_sr_port}") + private String generateServicePort; + + @Override public GenerateCaptionVO generateCaption(Long sketchElementId) { CollectionElement collectionElement = collectionElementMapper.selectById(sketchElementId); @@ -143,7 +147,7 @@ public class GenerateServiceImpl extends ServiceImpl i String category = generateThroughImageTextDTO.getLevel1Type().equals(SKETCH_BOARD.getRealName()) ? "sketch" : generateThroughImageTextDTO.getLevel1Type().equals(PRINT_BOARD.getRealName()) ? "print" : "moodboard"; String path = CommonConstant.GENERATE_PATH; - String port = CommonConstant.PYTHON_PORT_9996; + String port = generateServicePort; String jsonString = ""; HashMap params = new HashMap<>(); // 3.1 确定不同类型的印花分别调哪个接口 diff --git a/src/main/resources/application-dev.properties b/src/main/resources/application-dev.properties index 70ba01a1..f6224ea9 100644 --- a/src/main/resources/application-dev.properties +++ b/src/main/resources/application-dev.properties @@ -44,7 +44,7 @@ spring.servlet.multipart.max-request-size= 10MB #访问python服务的ip(对应环境) access.python.ip=http://18.167.251.121 access.python.port=9992 -access.python.sr=http://18.167.251.121:9994 +access.python.generate_sr_port=9994 access.python.address=http://18.167.251.121:9996 minio.endpoint=https://www.minio.aida.com.hk:9000 From 257c99698e647bfcd429bafdd8a05700ee3c885a Mon Sep 17 00:00:00 2001 From: xupei Date: Mon, 17 Jun 2024 13:21:58 +0800 Subject: [PATCH 6/8] fastapi -> flask --- src/main/java/com/ai/da/python/PythonService.java | 14 ++++++++------ .../ai/da/service/impl/ChatRobotServiceImpl.java | 4 ++-- src/main/resources/application-dev.properties | 2 +- 3 files changed, 11 insertions(+), 9 deletions(-) diff --git a/src/main/java/com/ai/da/python/PythonService.java b/src/main/java/com/ai/da/python/PythonService.java index 7eb77e1a..9f681376 100644 --- a/src/main/java/com/ai/da/python/PythonService.java +++ b/src/main/java/com/ai/da/python/PythonService.java @@ -2359,8 +2359,8 @@ public class PythonService { log.info("design请求python 参数:####{}", param); RequestBody body = RequestBody.create(mediaType, param); Request request = new Request.Builder() -// .url(accessPythonIp + ":" + accessPythonPort + "/api/design") - .url(fastApiPythonAddress + "/api/design") + .url(accessPythonIp + ":" + accessPythonPort + "/api/design") +// .url(fastApiPythonAddress + "/api/design") // .url(accessPythonIp + ":10200/aifda/api/v1.0/generate") .method("POST", body) .addHeader("Authorization", "Basic YWlkbGFiOjEyMw==") @@ -2466,8 +2466,8 @@ public class PythonService { System.out.println(JSON.toJSONString(content)); RequestBody body = RequestBody.create(mediaType, JSON.toJSONString(content)); Request request = new Request.Builder() -// .url(accessPythonIp + ":" + accessPythonPort + "/api/attribute_retrieve") - .url(fastApiPythonAddress + "/api/attribute_retrieve") + .url(accessPythonIp + ":" + accessPythonPort + "/api/attribute_retrieve") +// .url(fastApiPythonAddress + "/api/attribute_retrieve") // .url(accessPythonIp+":9991/aifda/api/v1.0/attribute_retrieval") .method("POST", body) .addHeader("Authorization", "Basic YWlkbGFiOjEyMw==") @@ -3262,9 +3262,11 @@ public class PythonService { String jsonString = JSON.toJSONString(content, SerializerFeature.WriteNullStringAsEmpty); RequestBody body = RequestBody.create(mediaType, jsonString); + String path = accessPythonIp + ":" + accessPythonPort + "/api/translateToEN"; + log.info("translateToEN 请求地址: {}", path); Request request = new Request.Builder() -// .url(accessPythonIp + ":" + accessPythonPort + "/api/translateToEN") - .url(fastApiPythonAddress + "/api/translateToEN") + .url(path) +// .url(fastApiPythonAddress + "/api/translateToEN") .method("POST", body) .addHeader("Content-Type", "application/json") .build(); diff --git a/src/main/java/com/ai/da/service/impl/ChatRobotServiceImpl.java b/src/main/java/com/ai/da/service/impl/ChatRobotServiceImpl.java index e6ea08c8..fdaecc96 100644 --- a/src/main/java/com/ai/da/service/impl/ChatRobotServiceImpl.java +++ b/src/main/java/com/ai/da/service/impl/ChatRobotServiceImpl.java @@ -152,8 +152,8 @@ public class ChatRobotServiceImpl implements ChatRobotService { RequestBody body = RequestBody.create(mediaType, param); Request request = new Request.Builder() // .url("http://127.0.0.1:5000/api/chat_stream_test") -// .url(accessPythonIp + ":" + accessPythonPort + "/api/chat_stream_test") - .url(fastApiPythonAddress + "/api/chat_robot") + .url(accessPythonIp + ":" + accessPythonPort + "/api/chat_stream_test") +// .url(fastApiPythonAddress + "/api/chat_robot") // .url(accessPythonIp + ":10200/aifda/api/v1.0/generate") .method("POST", body) .addHeader("Content-Type", "application/json") diff --git a/src/main/resources/application-dev.properties b/src/main/resources/application-dev.properties index f6224ea9..e54dd61e 100644 --- a/src/main/resources/application-dev.properties +++ b/src/main/resources/application-dev.properties @@ -45,7 +45,7 @@ spring.servlet.multipart.max-request-size= 10MB access.python.ip=http://18.167.251.121 access.python.port=9992 access.python.generate_sr_port=9994 -access.python.address=http://18.167.251.121:9996 +access.python.address=http://18.167.251.121:9994 minio.endpoint=https://www.minio.aida.com.hk:9000 minio.accessKey=admin From 2a2c4b1d391ed5945f4b0df963320ed4a9d97c24 Mon Sep 17 00:00:00 2001 From: xupei Date: Mon, 17 Jun 2024 13:31:44 +0800 Subject: [PATCH 7/8] =?UTF-8?q?slogan=E8=AE=BF=E9=97=AE=E5=9C=B0=E5=9D=80?= =?UTF-8?q?=E5=8F=98=E6=9B=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/java/com/ai/da/common/constant/CommonConstant.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/ai/da/common/constant/CommonConstant.java b/src/main/java/com/ai/da/common/constant/CommonConstant.java index 3fbee692..eb325fe6 100644 --- a/src/main/java/com/ai/da/common/constant/CommonConstant.java +++ b/src/main/java/com/ai/da/common/constant/CommonConstant.java @@ -21,7 +21,7 @@ public class CommonConstant { public static final String GENERATE_SINGLE_LOGO = "/api/generate_single_logo"; - public static final String GENERATE_SLOGAN = "/apislogan"; + public static final String GENERATE_SLOGAN = "/api/slogan"; public static final String PYTHON_PORT_9996 = "9996"; From 19524520f4e05b716a8e7df6f347b05dfae899d4 Mon Sep 17 00:00:00 2001 From: xupei Date: Mon, 17 Jun 2024 17:34:27 +0800 Subject: [PATCH 8/8] BUGFIX:sr --- src/main/java/com/ai/da/python/PythonService.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/ai/da/python/PythonService.java b/src/main/java/com/ai/da/python/PythonService.java index 9f681376..862a0a03 100644 --- a/src/main/java/com/ai/da/python/PythonService.java +++ b/src/main/java/com/ai/da/python/PythonService.java @@ -3224,7 +3224,7 @@ public class PythonService { String jsonString = JSON.toJSONString(content, SerializerFeature.WriteNullStringAsEmpty); RequestBody body = RequestBody.create(mediaType, jsonString); Request request = new Request.Builder() - .url(accessPythonIp + srServicePort + "/api/super_resolution") + .url(accessPythonIp + ":" + srServicePort + "/api/super_resolution") .method("POST", body) .addHeader("Content-Type", "application/json") .build();