style: fix typo and format code (#2618)

### What problem does this PR solve?

- Fix typo
- Remove unused import
- Format code

### Type of change

- [x] Other (please describe): typo and format
This commit is contained in:
yqkcn
2024-09-27 13:17:25 +08:00
committed by GitHub
parent 4c0b79c4f6
commit 34abcf7704
5 changed files with 12 additions and 16 deletions

View File

@ -169,8 +169,8 @@ class TenantLLMService(CommonService):
num = 0
try:
for u in cls.query(tenant_id = tenant_id, llm_name=mdlnm):
num += cls.model.update(used_tokens = u.used_tokens + used_tokens)\
for u in cls.query(tenant_id=tenant_id, llm_name=mdlnm):
num += cls.model.update(used_tokens=u.used_tokens + used_tokens)\
.where(cls.model.tenant_id == tenant_id, cls.model.llm_name == mdlnm)\
.execute()
except Exception as e:
@ -252,7 +252,6 @@ class LLMBundle(object):
return
yield chunk
def chat(self, system, history, gen_conf):
txt, used_tokens = self.mdl.chat(system, history, gen_conf)
if not TenantLLMService.increase_usage(