mirror of
https://github.com/infiniflow/ragflow.git
synced 2025-11-10 14:54:24 +00:00
layout refine (#115)
This commit is contained in:
parent
fa171dfe6c
commit
bcb58b7e71
@ -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
|
121:/ragflow# sudo sysctl -w vm.max_map_count=262144
|
||||||
```
|
```
|
||||||
However, this change is not persistent and will be reset after a system reboot.
|
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:
|
Add or update the following line in the file:
|
||||||
```bash
|
```bash
|
||||||
vm.max_map_count=262144
|
vm.max_map_count=262144
|
||||||
|
|||||||
@ -82,8 +82,19 @@ def set_api_key():
|
|||||||
@login_required
|
@login_required
|
||||||
def my_llms():
|
def my_llms():
|
||||||
try:
|
try:
|
||||||
objs = TenantLLMService.get_my_llms(current_user.id)
|
res = {}
|
||||||
return get_json_result(data=objs)
|
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:
|
except Exception as e:
|
||||||
return server_error_response(e)
|
return server_error_response(e)
|
||||||
|
|
||||||
|
|||||||
@ -49,7 +49,9 @@ class TenantLLMService(CommonService):
|
|||||||
LLMFactories.logo,
|
LLMFactories.logo,
|
||||||
LLMFactories.tags,
|
LLMFactories.tags,
|
||||||
cls.model.model_type,
|
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(
|
objs = cls.model.select(*fields).join(LLMFactories, on=(cls.model.llm_factory == LLMFactories.name)).where(
|
||||||
cls.model.tenant_id == tenant_id).dicts()
|
cls.model.tenant_id == tenant_id).dicts()
|
||||||
|
|
||||||
|
|||||||
@ -100,7 +100,7 @@ class LayoutRecognizer(Recognizer):
|
|||||||
i += 1
|
i += 1
|
||||||
|
|
||||||
for lt in ["footer", "header", "reference", "figure caption",
|
for lt in ["footer", "header", "reference", "figure caption",
|
||||||
"table caption", "title", "text", "table", "figure", "equation"]:
|
"table caption", "title", "table", "text", "figure", "equation"]:
|
||||||
findLayout(lt)
|
findLayout(lt)
|
||||||
|
|
||||||
# add box to figure layouts which has not text box
|
# add box to figure layouts which has not text box
|
||||||
|
|||||||
@ -101,7 +101,7 @@ def chunk(filename, binary=None, from_page=0, to_page=100000, lang="Chinese", ca
|
|||||||
d = copy.deepcopy(doc)
|
d = copy.deepcopy(doc)
|
||||||
if pdf_parser:
|
if pdf_parser:
|
||||||
d["image"], poss = pdf_parser.crop(ck, need_position=True)
|
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)
|
ck = pdf_parser.remove_tag(ck)
|
||||||
tokenize(d, ck, eng)
|
tokenize(d, ck, eng)
|
||||||
res.append(d)
|
res.append(d)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user