]> git.djapps.eu Git - pkg/ggml/sources/llama.cpp/commitdiff
server : (tests) don't use thread for capturing stdout/stderr, bump openai client...
authorXuan Son Nguyen <redacted>
Thu, 28 Nov 2024 18:17:49 +0000 (19:17 +0100)
committerGitHub <redacted>
Thu, 28 Nov 2024 18:17:49 +0000 (19:17 +0100)
* server : (tests) don't use thread for capturing stdout/stderr

* test: bump openai to 1.55.2

* bump openai to 1.55.3

examples/server/tests/requirements.txt
examples/server/tests/utils.py

index 935a79114b45e9a1f3b8b6461dd8815040c0471a..074b9d47bddce1f8c31733b7c55c1ae3ea7b99b0 100644 (file)
@@ -2,6 +2,6 @@ aiohttp~=3.9.3
 pytest~=8.3.3
 huggingface_hub~=0.23.2
 numpy~=1.26.4
-openai~=1.30.3
+openai~=1.55.3
 prometheus-client~=0.20.0
 requests~=2.32.3
index e31743c505d8e02d6f92bbe470fde52332a3e7d3..a831f113f41618c90282c3bf56ae546a420c6618 100644 (file)
@@ -8,7 +8,6 @@ import os
 import re
 import json
 import sys
-import threading
 import requests
 import time
 from concurrent.futures import ThreadPoolExecutor, as_completed
@@ -161,26 +160,12 @@ class ServerProcess:
         self.process = subprocess.Popen(
             [str(arg) for arg in [server_path, *server_args]],
             creationflags=flags,
-            stdout=subprocess.PIPE,
-            stderr=subprocess.PIPE,
+            stdout=sys.stdout,
+            stderr=sys.stdout,
             env={**os.environ, "LLAMA_CACHE": "tmp"},
         )
         server_instances.add(self)
 
-        def server_log(in_stream, out_stream):
-            for line in iter(in_stream.readline, b""):
-                print(line.decode("utf-8"), end="", file=out_stream)
-
-        thread_stdout = threading.Thread(
-            target=server_log, args=(self.process.stdout, sys.stdout), daemon=True
-        )
-        thread_stdout.start()
-
-        thread_stderr = threading.Thread(
-            target=server_log, args=(self.process.stderr, sys.stderr), daemon=True
-        )
-        thread_stderr.start()
-
         print(f"server pid={self.process.pid}, pytest pid={os.getpid()}")
 
         # wait for server to start