KevinHuSh commited on
Commit
c127ae4
·
1 Parent(s): cd46bb2

layout refine (#115)

Browse files
README.md CHANGED
@@ -18,7 +18,7 @@ If **vm.max_map_count** is not larger than 65535, please run the following comm
18
  121:/ragflow# sudo sysctl -w vm.max_map_count=262144
19
  ```
20
  However, this change is not persistent and will be reset after a system reboot.
21
- To make the change permanent, you need to update the **/etc/sysctl.conf file**.
22
  Add or update the following line in the file:
23
  ```bash
24
  vm.max_map_count=262144
 
18
  121:/ragflow# sudo sysctl -w vm.max_map_count=262144
19
  ```
20
  However, this change is not persistent and will be reset after a system reboot.
21
+ To make the change permanent, you need to update the **/etc/sysctl.conf**.
22
  Add or update the following line in the file:
23
  ```bash
24
  vm.max_map_count=262144
api/apps/llm_app.py CHANGED
@@ -82,8 +82,19 @@ def set_api_key():
82
  @login_required
83
  def my_llms():
84
  try:
85
- objs = TenantLLMService.get_my_llms(current_user.id)
86
- return get_json_result(data=objs)
 
 
 
 
 
 
 
 
 
 
 
87
  except Exception as e:
88
  return server_error_response(e)
89
 
 
82
  @login_required
83
  def my_llms():
84
  try:
85
+ res = {}
86
+ for o in TenantLLMService.get_my_llms(current_user.id):
87
+ if o["llm_factory"] not in res:
88
+ res[o["llm_factory"]] = {
89
+ "tags": o["tags"],
90
+ "llm": []
91
+ }
92
+ res[o["llm_factory"]]["llm"].append({
93
+ "type": o["model_type"],
94
+ "name": o["model_name"],
95
+ "used_token": o["used_tokens"]
96
+ })
97
+ return get_json_result(data=res)
98
  except Exception as e:
99
  return server_error_response(e)
100
 
api/db/services/llm_service.py CHANGED
@@ -49,7 +49,9 @@ class TenantLLMService(CommonService):
49
  LLMFactories.logo,
50
  LLMFactories.tags,
51
  cls.model.model_type,
52
- cls.model.llm_name]
 
 
53
  objs = cls.model.select(*fields).join(LLMFactories, on=(cls.model.llm_factory == LLMFactories.name)).where(
54
  cls.model.tenant_id == tenant_id).dicts()
55
 
 
49
  LLMFactories.logo,
50
  LLMFactories.tags,
51
  cls.model.model_type,
52
+ cls.model.llm_name,
53
+ cls.model.used_tokens
54
+ ]
55
  objs = cls.model.select(*fields).join(LLMFactories, on=(cls.model.llm_factory == LLMFactories.name)).where(
56
  cls.model.tenant_id == tenant_id).dicts()
57
 
deepdoc/vision/layout_recognizer.py CHANGED
@@ -100,7 +100,7 @@ class LayoutRecognizer(Recognizer):
100
  i += 1
101
 
102
  for lt in ["footer", "header", "reference", "figure caption",
103
- "table caption", "title", "text", "table", "figure", "equation"]:
104
  findLayout(lt)
105
 
106
  # add box to figure layouts which has not text box
 
100
  i += 1
101
 
102
  for lt in ["footer", "header", "reference", "figure caption",
103
+ "table caption", "title", "table", "text", "figure", "equation"]:
104
  findLayout(lt)
105
 
106
  # add box to figure layouts which has not text box
rag/app/naive.py CHANGED
@@ -101,7 +101,7 @@ def chunk(filename, binary=None, from_page=0, to_page=100000, lang="Chinese", ca
101
  d = copy.deepcopy(doc)
102
  if pdf_parser:
103
  d["image"], poss = pdf_parser.crop(ck, need_position=True)
104
- add_positions(d, poss, from_page)
105
  ck = pdf_parser.remove_tag(ck)
106
  tokenize(d, ck, eng)
107
  res.append(d)
 
101
  d = copy.deepcopy(doc)
102
  if pdf_parser:
103
  d["image"], poss = pdf_parser.crop(ck, need_position=True)
104
+ add_positions(d, poss)
105
  ck = pdf_parser.remove_tag(ck)
106
  tokenize(d, ck, eng)
107
  res.append(d)