Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

layout refine #115

Merged
merged 1 commit into from
Mar 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
15 changes: 13 additions & 2 deletions api/apps/llm_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
4 changes: 3 additions & 1 deletion api/db/services/llm_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,9 @@ def get_my_llms(cls, tenant_id):
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()

Expand Down
2 changes: 1 addition & 1 deletion deepdoc/vision/layout_recognizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ def findLayout(ty):
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
Expand Down
2 changes: 1 addition & 1 deletion rag/app/naive.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down