mirror of
https://github.com/BoardWare-Genius/jarvis-models.git
synced 2025-12-13 16:53:24 +00:00
feat: logging time
This commit is contained in:
@ -1,7 +1,10 @@
|
|||||||
|
import logging
|
||||||
from typing import Any, Coroutine
|
from typing import Any, Coroutine
|
||||||
|
|
||||||
from fastapi import Request, Response, status
|
from fastapi import Request, Response, status
|
||||||
from fastapi.responses import JSONResponse
|
from fastapi.responses import JSONResponse
|
||||||
|
|
||||||
|
from ..log.logging_time import logging_time
|
||||||
from .blackbox import Blackbox
|
from .blackbox import Blackbox
|
||||||
|
|
||||||
import requests
|
import requests
|
||||||
@ -10,6 +13,9 @@ from openai import OpenAI
|
|||||||
import re
|
import re
|
||||||
|
|
||||||
from injector import singleton
|
from injector import singleton
|
||||||
|
|
||||||
|
logger = logging.getLogger
|
||||||
|
|
||||||
@singleton
|
@singleton
|
||||||
class Chat(Blackbox):
|
class Chat(Blackbox):
|
||||||
|
|
||||||
@ -21,6 +27,7 @@ class Chat(Blackbox):
|
|||||||
return isinstance(data, list)
|
return isinstance(data, list)
|
||||||
|
|
||||||
# model_name有 Qwen1.5-14B-Chat , internlm2-chat-20b
|
# model_name有 Qwen1.5-14B-Chat , internlm2-chat-20b
|
||||||
|
@logging_time(logger=logger)
|
||||||
def processing(self, model_name, prompt, template, context: list, temperature, top_p, n, max_tokens,stop,frequency_penalty,presence_penalty) -> str:
|
def processing(self, model_name, prompt, template, context: list, temperature, top_p, n, max_tokens,stop,frequency_penalty,presence_penalty) -> str:
|
||||||
if context == None:
|
if context == None:
|
||||||
context = []
|
context = []
|
||||||
|
|||||||
Reference in New Issue
Block a user