Adding RAG tracing & eval cookbook using Parea (#390)
This commit is contained in:
@@ -9,6 +9,7 @@ from concurrent.futures import ThreadPoolExecutor
|
||||
from contextlib import contextmanager
|
||||
from typing import Any, Callable, Dict, List, Optional, Union
|
||||
|
||||
import contextvars
|
||||
import tqdm
|
||||
|
||||
from sglang.global_config import global_config
|
||||
@@ -218,7 +219,10 @@ class StreamExecutor:
|
||||
self.use_thread = use_thread
|
||||
if self.use_thread:
|
||||
self.queue = queue.Queue()
|
||||
self.worker = threading.Thread(target=self._thread_worker_func)
|
||||
|
||||
def _run_worker_in_context():
|
||||
self._thread_worker_func()
|
||||
self.worker = threading.Thread(target=contextvars.copy_context().run, args=(_run_worker_in_context, ))
|
||||
self.worker.start()
|
||||
|
||||
# For streaming
|
||||
|
||||
Reference in New Issue
Block a user