Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions src/bespokelabs/curator/llm/llm.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@
generation_params: dict | None = None,
backend_params: BackendParamsType | None = None,
system_prompt: str | None = None,
default_app_id: Optional[str] = None,
):
"""Initialize a LLM.

Expand Down Expand Up @@ -117,6 +118,7 @@
- gpu_memory_utilization: The GPU memory utilization to use for the VLLM backend
- batch_size: The size of the batch to use, only used if batch is True
system_prompt: The system prompt to use for the LLM
default_app_id: The default application ID to use when opening datasets in Curator Viewer
"""
generation_params = generation_params or {}

Expand All @@ -143,6 +145,8 @@
return_completions_object=self.return_completions_object,
)

self.default_app_id = default_app_id

def _hash_fingerprint(self, dataset_hash: str = "", disable_cache: bool = False):
if disable_cache:
fingerprint = xxh64(os.urandom(8)).hexdigest()
Expand Down Expand Up @@ -262,6 +266,10 @@
"run_hash": fingerprint,
"batch_mode": self.batch_mode,
}

Check failure on line 269 in src/bespokelabs/curator/llm/llm.py

View workflow job for this annotation

GitHub Actions / test-integration

Ruff (W293)

src/bespokelabs/curator/llm/llm.py:269:1: W293 Blank line contains whitespace
# Only include default_app_id in metadata dictionary if it's not None
if self.default_app_id is not None:
metadata_dict["default_app_id"] = self.default_app_id

existing_session_id = metadata_db.get_existing_session_id(metadata_dict["run_hash"])
existing_viewer_sync = metadata_db.check_existing_hosted_sync(metadata_dict["run_hash"])
Expand Down
Loading