Skip to content

Commit 73aed96

Browse files
committed
Fix typo
Signed-off-by: Jin Hai <haijin.chn@gmail.com>
1 parent 64e281b commit 73aed96

File tree

8 files changed

+22
-22
lines changed

8 files changed

+22
-22
lines changed

api/db/init_data.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,14 +84,14 @@ def init_superuser():
8484
{"role": "user", "content": "Hello!"}], gen_conf={})
8585
if msg.find("ERROR: ") == 0:
8686
logging.error(
87-
"'{}' dosen't work. {}".format(
87+
"'{}' doesn't work. {}".format(
8888
tenant["llm_id"],
8989
msg))
9090
embd_mdl = LLMBundle(tenant["id"], LLMType.EMBEDDING, tenant["embd_id"])
9191
v, c = embd_mdl.encode(["Hello!"])
9292
if c == 0:
9393
logging.error(
94-
"'{}' dosen't work!".format(
94+
"'{}' doesn't work!".format(
9595
tenant["embd_id"]))
9696

9797

api/db/services/canvas_service.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -73,11 +73,11 @@ def get_by_tenant_id(cls, pid):
7373
User.nickname,
7474
User.avatar.alias('tenant_avatar'),
7575
]
76-
angents = cls.model.select(*fields) \
76+
agents = cls.model.select(*fields) \
7777
.join(User, on=(cls.model.user_id == User.id)) \
7878
.where(cls.model.id == pid)
7979
# obj = cls.model.query(id=pid)[0]
80-
return True, angents.dicts()[0]
80+
return True, agents.dicts()[0]
8181
except Exception as e:
8282
print(e)
8383
return False, None
@@ -100,25 +100,25 @@ def get_by_tenant_ids(cls, joined_tenant_ids, user_id,
100100
cls.model.update_time
101101
]
102102
if keywords:
103-
angents = cls.model.select(*fields).join(User, on=(cls.model.user_id == User.id)).where(
103+
agents = cls.model.select(*fields).join(User, on=(cls.model.user_id == User.id)).where(
104104
((cls.model.user_id.in_(joined_tenant_ids) & (cls.model.permission ==
105105
TenantPermission.TEAM.value)) | (
106106
cls.model.user_id == user_id)),
107107
(fn.LOWER(cls.model.title).contains(keywords.lower()))
108108
)
109109
else:
110-
angents = cls.model.select(*fields).join(User, on=(cls.model.user_id == User.id)).where(
110+
agents = cls.model.select(*fields).join(User, on=(cls.model.user_id == User.id)).where(
111111
((cls.model.user_id.in_(joined_tenant_ids) & (cls.model.permission ==
112112
TenantPermission.TEAM.value)) | (
113113
cls.model.user_id == user_id))
114114
)
115115
if desc:
116-
angents = angents.order_by(cls.model.getter_by(orderby).desc())
116+
agents = agents.order_by(cls.model.getter_by(orderby).desc())
117117
else:
118-
angents = angents.order_by(cls.model.getter_by(orderby).asc())
119-
count = angents.count()
120-
angents = angents.paginate(page_number, items_per_page)
121-
return list(angents.dicts()), count
118+
agents = agents.order_by(cls.model.getter_by(orderby).asc())
119+
count = agents.count()
120+
agents = agents.paginate(page_number, items_per_page)
121+
return list(agents.dicts()), count
122122

123123

124124
def completion(tenant_id, agent_id, question, session_id=None, stream=True, **kwargs):

api/ragflow_server.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@
1818
# from beartype.claw import beartype_all # <-- you didn't sign up for this
1919
# beartype_all(conf=BeartypeConf(violation_type=UserWarning)) # <-- emit warnings from all code
2020

21-
from api.utils.log_utils import initRootLogger
21+
from api.utils.log_utils import init_root_logger
2222
from plugin import GlobalPluginManager
23-
initRootLogger("ragflow_server")
23+
init_root_logger("ragflow_server")
2424

2525
import logging
2626
import os

api/utils/file_utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ def filename_type(filename):
158158
if re.match(r".*\.(eml|doc|docx|ppt|pptx|yml|xml|htm|json|csv|txt|ini|xls|xlsx|wps|rtf|hlp|pages|numbers|key|md|py|js|java|c|cpp|h|php|go|ts|sh|cs|kt|html|sql)$", filename):
159159
return FileType.DOC.value
160160

161-
if re.match(r".*\.(wav|flac|ape|alac|wavpack|wv|mp3|aac|ogg|vorbis|opus|mp3)$", filename):
161+
if re.match(r".*\.(wav|flac|ape|alac|wavpack|wv|mp3|aac|ogg|vorbis|opus)$", filename):
162162
return FileType.AURAL.value
163163

164164
if re.match(r".*\.(jpg|jpeg|png|tif|gif|pcx|tga|exif|fpx|svg|psd|cdr|pcd|dxf|ufo|eps|ai|raw|WMF|webp|avif|apng|icon|ico|mpg|mpeg|avi|rm|rmvb|mov|wmv|asf|dat|asx|wvx|mpe|mpa|mp4)$", filename):

api/utils/log_utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ def get_project_base_directory():
3030
)
3131
return PROJECT_BASE
3232

33-
def initRootLogger(logfile_basename: str, log_format: str = "%(asctime)-15s %(levelname)-8s %(process)d %(message)s"):
33+
def init_root_logger(logfile_basename: str, log_format: str = "%(asctime)-15s %(levelname)-8s %(process)d %(message)s"):
3434
global initialized_root_logger
3535
if initialized_root_logger:
3636
return

api/utils/t_crypt.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,6 @@ def crypt(line):
3535

3636

3737
if __name__ == "__main__":
38-
pswd = crypt(sys.argv[1])
39-
print(pswd)
40-
print(decrypt(pswd))
38+
passwd = crypt(sys.argv[1])
39+
print(passwd)
40+
print(decrypt(passwd))

api/utils/validation_utils.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -312,7 +312,7 @@ class PermissionEnum(StrEnum):
312312
team = auto()
313313

314314

315-
class ChunkMethodnEnum(StrEnum):
315+
class ChunkMethodEnum(StrEnum):
316316
naive = auto()
317317
book = auto()
318318
email = auto()
@@ -382,7 +382,7 @@ class CreateDatasetReq(Base):
382382
description: str | None = Field(default=None, max_length=65535)
383383
embedding_model: Annotated[str, StringConstraints(strip_whitespace=True, max_length=255), Field(default="", serialization_alias="embd_id")]
384384
permission: PermissionEnum = Field(default=PermissionEnum.me, min_length=1, max_length=16)
385-
chunk_method: ChunkMethodnEnum = Field(default=ChunkMethodnEnum.naive, min_length=1, max_length=32, serialization_alias="parser_id")
385+
chunk_method: ChunkMethodEnum = Field(default=ChunkMethodEnum.naive, min_length=1, max_length=32, serialization_alias="parser_id")
386386
parser_config: ParserConfig | None = Field(default=None)
387387

388388
@field_validator("avatar")

rag/svr/task_executor.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
import threading
2222
import time
2323

24-
from api.utils.log_utils import initRootLogger, get_project_base_directory
24+
from api.utils.log_utils import init_root_logger, get_project_base_directory
2525
from graphrag.general.index import run_graphrag
2626
from graphrag.utils import get_llm_cache, set_llm_cache, get_tags_from_cache, set_tags_to_cache
2727
from rag.prompts import keyword_extraction, question_proposal, content_tagging
@@ -773,5 +773,5 @@ async def main():
773773

774774
if __name__ == "__main__":
775775
faulthandler.enable()
776-
initRootLogger(CONSUMER_NAME)
776+
init_root_logger(CONSUMER_NAME)
777777
trio.run(main)

0 commit comments

Comments
 (0)