Spaces:
Running
Running
Husnain
commited on
Commit
•
943f394
1
Parent(s):
c0838c6
♻️ [Refactor] Rename gpt-3.5 to gpt-3.5-turbo
Browse files- apis/chat_api.py +1 -8
apis/chat_api.py
CHANGED
@@ -87,15 +87,8 @@ class ChatAPIApp:
|
|
87 |
)
|
88 |
|
89 |
def chat_completions(
|
90 |
-
self, item: ChatCompletionsPostItem,
|
91 |
):
|
92 |
-
api_key=credentials.credentials
|
93 |
-
if api_key != os.getenv("HF_TOKEN"):
|
94 |
-
raise HTTPException(
|
95 |
-
status_code=status.HTTP_401_UNAUTHORIZED,
|
96 |
-
detail="Invalid authorization code",
|
97 |
-
)
|
98 |
-
|
99 |
if item.model == "gpt-3.5-turbo":
|
100 |
streamer = OpenaiStreamer()
|
101 |
stream_response = streamer.chat_response(messages=item.messages)
|
|
|
87 |
)
|
88 |
|
89 |
def chat_completions(
|
90 |
+
self, item: ChatCompletionsPostItem, api_key: str = Depends(extract_api_key)
|
91 |
):
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
92 |
if item.model == "gpt-3.5-turbo":
|
93 |
streamer = OpenaiStreamer()
|
94 |
stream_response = streamer.chat_response(messages=item.messages)
|