Spaces:
Running
Running
:recycle: [Refactor] Rename gpt-3.5 to gpt-3.5-turbo
Browse filesFiles changed (3)
88 unmodified lines8990919293949588 unmodified linesdef chat_completions(self, item: ChatCompletionsPostItem, api_key: str = Depends(extract_api_key)):if item.model == "gpt-3.5":streamer = OpenaiStreamer()stream_response = streamer.chat_response(messages=item.messages)else:88 unmodified lines8990919293949588 unmodified linesdef chat_completions(self, item: ChatCompletionsPostItem, api_key: str = Depends(extract_api_key)):if item.model == "gpt-3.5-turbo":streamer = OpenaiStreamer()stream_response = streamer.chat_response(messages=item.messages)else:
21 unmodified lines222324252627285 unmodified lines3435363738394034 unmodified lines7576777879808121 unmodified lines"mistral-7b": 32768,"openchat-3.5": 8192,"gemma-7b": 8192,"gpt-3.5": 8192,}TOKEN_RESERVED = 205 unmodified lines"mistral-7b","openchat-3.5","gemma-7b","gpt-3.5",]# https://platform.openai.com/docs/api-reference/models/list34 unmodified lines"owned_by": "Google",},{"id": "gpt-3.5","description": "[openai/gpt-3.5-turbo]: https://platform.openai.com/docs/models/gpt-3-5-turbo","object": "model","created": 1700000000,21 unmodified lines222324252627285 unmodified lines3435363738394034 unmodified lines7576777879808121 unmodified lines"mistral-7b": 32768,"openchat-3.5": 8192,"gemma-7b": 8192,"gpt-3.5-turbo": 8192,}TOKEN_RESERVED = 205 unmodified lines"mistral-7b","openchat-3.5","gemma-7b","gpt-3.5-turbo",]# https://platform.openai.com/docs/api-reference/models/list34 unmodified lines"owned_by": "Google",},{"id": "gpt-3.5-turbo","description": "[openai/gpt-3.5-turbo]: https://platform.openai.com/docs/models/gpt-3-5-turbo","object": "model","created": 1700000000,
148 unmodified lines149150151152153154155156148 unmodified linesclass OpenaiStreamer:def __init__(self):self.model = "gpt-3.5"self.message_outputer = OpenaiStreamOutputer(owned_by="openai", model="gpt-3.5")self.tokenizer = tiktoken.get_encoding("cl100k_base")def count_tokens(self, messages: list[dict]):148 unmodified lines149150151152153154155156157158148 unmodified linesclass OpenaiStreamer:def __init__(self):self.model = "gpt-3.5-turbo"self.message_outputer = OpenaiStreamOutputer(owned_by="openai", model="gpt-3.5-turbo")self.tokenizer = tiktoken.get_encoding("cl100k_base")def count_tokens(self, messages: list[dict]):
apis/chat_api.py+1-1
constants/models.py+3-3
networks/openai_streamer.py+4-2