MCPcopy Create free account
hub / github.com/Open-Bee/DataStudio / _init_shared_data

Function _init_shared_data

datastudio/models/mp_openai_api.py:30–41  ·  view source on GitHub ↗

Set module-level globals before forking workers. Must be called in the main process before Pool creation. Args: messages: The full pre-encoded messages list. model_kwargs: Dict of OpenAIAPI constructor arguments.

(messages: List[Any], model_kwargs: dict)

Source from the content-addressed store, hash-verified

28
29
30def _init_shared_data(messages: List[Any], model_kwargs: dict):
31 """Set module-level globals before forking workers.
32
33 Must be called in the main process before Pool creation.
34
35 Args:
36 messages: The full pre-encoded messages list.
37 model_kwargs: Dict of OpenAIAPI constructor arguments.
38 """
39 global _SHARED_MESSAGES, _SHARED_MODEL_KWARGS
40 _SHARED_MESSAGES = messages
41 _SHARED_MODEL_KWARGS = model_kwargs
42
43
44def _clear_shared_data():

Callers 1

generateMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected