diff --git a/.vscode/settings.json b/.vscode/settings.json index bfdaf09..6036ec6 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -7,9 +7,9 @@ "**/.DS_Store": true, "**/Thumbs.db": true, "**/__pycache__": true, - "**/*.css.map": true, "**/.vscode": true, "**/*.map": true, + "**/*.css.map": true, "tests/__pycache__": true }, "hide-files.files": [ diff --git a/api/config/config.yml b/api/config/config.yml index 5ea6eb6..564b0dd 100644 --- a/api/config/config.yml +++ b/api/config/config.yml @@ -6,10 +6,9 @@ costs: other: 5 chat-models: - gpt-4-32k-azure: 100 + gpt-4-32k: 200 gpt-4: 50 - gpt-4-azure: 10 - gpt-3: 5 + gpt-3: 10 ## Roles Explanation diff --git a/api/responder.py b/api/responder.py index 7b6f6a8..e515c84 100644 --- a/api/responder.py +++ b/api/responder.py @@ -147,13 +147,15 @@ async def respond( print('[!] too many requests') continue + chunk_no = 0 async for chunk in response.content.iter_any(): + chunk_no += 1 chunk = chunk.decode('utf8').strip() if 'azure' in provider_name: chunk = chunk.strip().replace('data: ', '') - if not chunk or 'prompt_filter_results' in chunk: + if not chunk or chunk_no == 1: continue yield chunk + '\n\n' diff --git a/checks/client.py b/checks/client.py index a149377..7410c23 100644 --- a/checks/client.py +++ b/checks/client.py @@ -216,7 +216,7 @@ async def demo(): raise ConnectionError('API Server is not running.') for func in [ - # test_chat_non_stream_gpt4, + test_chat_non_stream_gpt4, test_chat_stream_gpt3 ]: print(f'[*] {func.__name__}')