From 3b8dfff974618499b177c5a724638919b93b702e Mon Sep 17 00:00:00 2001 From: Heiner Lohaus Date: Mon, 18 Sep 2023 07:15:43 +0200 Subject: Improve event loop --- testing/test_needs_auth.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'testing/test_needs_auth.py') diff --git a/testing/test_needs_auth.py b/testing/test_needs_auth.py index 3cef1c61..26630e23 100644 --- a/testing/test_needs_auth.py +++ b/testing/test_needs_auth.py @@ -17,7 +17,7 @@ _providers = [ g4f.Provider.Bard ] -_instruct = "Hello, tell about you in one sentence." +_instruct = "Hello, are you GPT 4?." _example = """ OpenaiChat: Hello! How can I assist you today? 2.0 secs @@ -39,14 +39,14 @@ No Stream Total: 10.14 secs print("Bing: ", end="") for response in log_time_yield( g4f.ChatCompletion.create, - model=g4f.models.gpt_35_turbo, + model=g4f.models.default, messages=[{"role": "user", "content": _instruct}], provider=g4f.Provider.Bing, #cookies=g4f.get_cookies(".huggingface.co"), - #stream=True, + stream=True, auth=True ): - print(response, end="") + print(response, end="", flush=True) print() print() @@ -75,7 +75,7 @@ def run_stream(): model=None, messages=[{"role": "user", "content": _instruct}], ): - print(response, end="") + print(response, end="", flush=True) print() print("Stream Total:", log_time(run_stream)) print() -- cgit v1.2.3