add logs for state cache and switch-model

This commit is contained in:
josc146
2023-06-09 20:46:19 +08:00
parent b7c34b0d42
commit cea1d8b4d1
4 changed files with 12 additions and 7 deletions

View File

@@ -16,7 +16,7 @@ logger.addHandler(fh)
def quick_log(request: Request, body: Any, response: str):
logger.info(
f"Client: {request.client}\nUrl: {request.url}\n"
f"Client: {request.client if request else ''}\nUrl: {request.url if request else ''}\n"
+ (
f"Body: {json.dumps(body.__dict__, default=vars, ensure_ascii=False)}\n"
if body

View File

@@ -105,7 +105,7 @@ The following is a coherent verbose detailed conversation between a girl named {
delta_prompt = prompt
try:
cache = state_cache.longest_prefix_state(
state_cache.LongestPrefixStateBody(prompt=prompt)
state_cache.LongestPrefixStateBody(prompt=prompt), None
)
except HTTPException:
pass