From a62ffe5be02f95332d346406749ad50d285fc7c6 Mon Sep 17 00:00:00 2001 From: Kevin Hu Date: Mon, 23 Dec 2024 11:18:01 +0800 Subject: [PATCH] Add Llama3.3 (#4174) ### What problem does this PR solve? #4168 ### Type of change - [x] New Feature (non-breaking change which adds functionality) --- conf/llm_factories.json | 12 ++++++++++++ deepdoc/vision/recognizer.py | 5 +++-- rag/utils/s3_conn.py | 1 - 3 files changed, 15 insertions(+), 3 deletions(-) diff --git a/conf/llm_factories.json b/conf/llm_factories.json index 64e680b2220..acd06ba6799 100644 --- a/conf/llm_factories.json +++ b/conf/llm_factories.json @@ -1014,6 +1014,18 @@ "max_tokens": 131072, "model_type": "chat" }, + { + "llm_name": "llama-3.3-70b-versatile", + "tags": "LLM,CHAT,128k", + "max_tokens": 128000, + "model_type": "chat" + }, + { + "llm_name": "llama-3.3-70b-specdec", + "tags": "LLM,CHAT,8k", + "max_tokens": 8192, + "model_type": "chat" + }, { "llm_name": "mixtral-8x7b-32768", "tags": "LLM,CHAT,5k", diff --git a/deepdoc/vision/recognizer.py b/deepdoc/vision/recognizer.py index 35ccbdea158..ec6ac9308fc 100644 --- a/deepdoc/vision/recognizer.py +++ b/deepdoc/vision/recognizer.py @@ -26,6 +26,7 @@ from .operators import * # noqa: F403 from .operators import preprocess + class Recognizer(object): def __init__(self, label_list, task_name, model_dir=None): """ @@ -144,11 +145,11 @@ def overlapped_area(a, b, ratio=True): return 0 x0_ = max(b["x0"], x0) x1_ = min(b["x1"], x1) - assert x0_ <= x1_, "Fuckedup! T:{},B:{},X0:{},X1:{} ==> {}".format( + assert x0_ <= x1_, "Bbox mismatch! T:{},B:{},X0:{},X1:{} ==> {}".format( tp, btm, x0, x1, b) tp_ = max(b["top"], tp) btm_ = min(b["bottom"], btm) - assert tp_ <= btm_, "Fuckedup! T:{},B:{},X0:{},X1:{} => {}".format( + assert tp_ <= btm_, "Bbox mismatch! T:{},B:{},X0:{},X1:{} => {}".format( tp, btm, x0, x1, b) ov = (btm_ - tp_) * (x1_ - x0_) if x1 - \ x0 != 0 and btm - tp != 0 else 0 diff --git a/rag/utils/s3_conn.py b/rag/utils/s3_conn.py index f053a13cc89..abc08db6bb5 100644 --- a/rag/utils/s3_conn.py +++ b/rag/utils/s3_conn.py @@ -1,6 +1,5 @@ import logging import boto3 -import os from botocore.exceptions import ClientError from botocore.client import Config import time