Skip to content
Open
Changes from 1 commit
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
5 changes: 5 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 @@ def __init__(
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 @@ def __init__(
- 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 @@ def __init__(
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 @@ -261,6 +265,7 @@ def __call__(
"response_format": (str(self.prompt_formatter.response_format.model_json_schema()) if self.prompt_formatter.response_format else "text"),
"run_hash": fingerprint,
"batch_mode": self.batch_mode,
"default_app_id": self.default_app_id,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

only send this if it isn't NULL

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed.

}

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