diff --git a/README.md b/README.md index 871c6fc2d022e6eb37aacc3748c4da8fee2675ae..79a5fcf3df7974f2754a4885b77dc9fab0767d7f 100644 --- a/README.md +++ b/README.md @@ -18,7 +18,7 @@ If **vm.max_map_count** is not larger than 65535, please run the following comm 121:/ragflow# sudo sysctl -w vm.max_map_count=262144 ``` However, this change is not persistent and will be reset after a system reboot. -To make the change permanent, you need to update the **/etc/sysctl.conf file**. +To make the change permanent, you need to update the **/etc/sysctl.conf**. Add or update the following line in the file: ```bash vm.max_map_count=262144 diff --git a/api/apps/llm_app.py b/api/apps/llm_app.py index 0a1167b6f67596589da14f7e7db3d3de0f822c26..9f22a32eba28897d70f4c08159835e6c0f5d949e 100644 --- a/api/apps/llm_app.py +++ b/api/apps/llm_app.py @@ -82,8 +82,19 @@ def set_api_key(): @login_required def my_llms(): try: - objs = TenantLLMService.get_my_llms(current_user.id) - return get_json_result(data=objs) + res = {} + for o in TenantLLMService.get_my_llms(current_user.id): + if o["llm_factory"] not in res: + res[o["llm_factory"]] = { + "tags": o["tags"], + "llm": [] + } + res[o["llm_factory"]]["llm"].append({ + "type": o["model_type"], + "name": o["model_name"], + "used_token": o["used_tokens"] + }) + return get_json_result(data=res) except Exception as e: return server_error_response(e) diff --git a/api/db/services/llm_service.py b/api/db/services/llm_service.py index 2a96474024640bb780112e2f9dc62b44c922c1a2..67dd70cae938c37fb68caf26e6aec94fb73aca44 100644 --- a/api/db/services/llm_service.py +++ b/api/db/services/llm_service.py @@ -49,7 +49,9 @@ class TenantLLMService(CommonService): LLMFactories.logo, LLMFactories.tags, cls.model.model_type, - cls.model.llm_name] + cls.model.llm_name, + cls.model.used_tokens + ] objs = cls.model.select(*fields).join(LLMFactories, on=(cls.model.llm_factory == LLMFactories.name)).where( cls.model.tenant_id == tenant_id).dicts() diff --git a/deepdoc/vision/layout_recognizer.py b/deepdoc/vision/layout_recognizer.py index 4851b8ebefa3cec2c4d57f746188d144b6cafd9f..f38a0f539aa909b45d49892e2d78cd23496f6dec 100644 --- a/deepdoc/vision/layout_recognizer.py +++ b/deepdoc/vision/layout_recognizer.py @@ -100,7 +100,7 @@ class LayoutRecognizer(Recognizer): i += 1 for lt in ["footer", "header", "reference", "figure caption", - "table caption", "title", "text", "table", "figure", "equation"]: + "table caption", "title", "table", "text", "figure", "equation"]: findLayout(lt) # add box to figure layouts which has not text box diff --git a/rag/app/naive.py b/rag/app/naive.py index 7b7aa4a07668ff0f8273e474e145c427897c220b..82ecfca7cce6953b3e2b3cd04faee2dbeea120b1 100644 --- a/rag/app/naive.py +++ b/rag/app/naive.py @@ -101,7 +101,7 @@ def chunk(filename, binary=None, from_page=0, to_page=100000, lang="Chinese", ca d = copy.deepcopy(doc) if pdf_parser: d["image"], poss = pdf_parser.crop(ck, need_position=True) - add_positions(d, poss, from_page) + add_positions(d, poss) ck = pdf_parser.remove_tag(ck) tokenize(d, ck, eng) res.append(d)