|
|
@@ -695,9 +695,47 @@ class ExtractTitleFeatures(Const):
|
|
|
await self.update_status_batch(
|
|
|
id_list, self.INIT_STATUS, self.PROCESSING_STATUS
|
|
|
)
|
|
|
- feature_dict = fetch_deepseek_completion(
|
|
|
- model="default", prompt=prompt, output_type="json"
|
|
|
- )
|
|
|
+
|
|
|
+ try:
|
|
|
+ feature_dict = fetch_deepseek_completion(
|
|
|
+ model="default", prompt=prompt, output_type="json"
|
|
|
+ )
|
|
|
+ except Exception as e:
|
|
|
+ await self.aliyun_log.log(
|
|
|
+ contents={
|
|
|
+ "task": "extract_title_features",
|
|
|
+ "function": "deal",
|
|
|
+ "message": "fetch deepseek completion failed",
|
|
|
+ "status": "fail",
|
|
|
+ "data": {
|
|
|
+ "error_message": str(e),
|
|
|
+ "error_type": type(e).__name__,
|
|
|
+ "traceback": traceback.format_exc(),
|
|
|
+ },
|
|
|
+ }
|
|
|
+ )
|
|
|
+ await self.update_status_batch(
|
|
|
+ id_list, self.PROCESSING_STATUS, self.FAIL_STATUS
|
|
|
+ )
|
|
|
+ return
|
|
|
+ if not feature_dict:
|
|
|
+ await self.aliyun_log.log(
|
|
|
+ contents={
|
|
|
+ "task": "extract_title_features",
|
|
|
+ "function": "deal",
|
|
|
+ "message": "fetch deepseek completion return empty",
|
|
|
+ "status": "fail",
|
|
|
+ "data": {
|
|
|
+ "error_message": "fetch deepseek completion return empty",
|
|
|
+ "error_type": "EmptyResponseError",
|
|
|
+ "traceback": traceback.format_exc(),
|
|
|
+ },
|
|
|
+ }
|
|
|
+ )
|
|
|
+ await self.update_status_batch(
|
|
|
+ id_list, self.PROCESSING_STATUS, self.FAIL_STATUS
|
|
|
+ )
|
|
|
+ return
|
|
|
|
|
|
for title in tqdm(title_list):
|
|
|
features = feature_dict.get(title, {})
|