소스 검색

refac: unnecessary max_token value removed

Timothy J. Baek 1 년 전
부모
커밋
781be2779b
1개의 변경된 파일2개의 추가작업 그리고 4개의 파일을 삭제
  1. 2 4
      backend/apps/openai/main.py

+ 2 - 4
backend/apps/openai/main.py

@@ -147,13 +147,11 @@ async def proxy(path: str, request: Request, user=Depends(get_verified_user)):
             print("Modified body_dict:", body)
 
         # Fix for ChatGPT calls failing because the num_ctx key is in body
-        if 'num_ctx' in body:
+        if "num_ctx" in body:
             # If 'num_ctx' is in the dictionary, delete it
             # Leaving it there generates an error with the
             # OpenAI API (Feb 2024)
-            del body['num_ctx']
-        # OpenAI API (Feb 2024) accepts max_tokens
-        body["max_tokens"] = 1600
+            del body["num_ctx"]
 
         # Convert the modified body back to JSON
         body = json.dumps(body)