SafetensorsLLMInContextGenerator
Guide & worked example · Source
SafetensorsLLMInContextGenerator(
model_path,
tokenizer_path=None,
examples=32,
max_new_tokens=512,
temperature=0.7,
do_sample=True,
load_in_4bit=False,
max_attempts=20,
rows_per_prompt=None,
progress_path=None,
device=None,
)Generate CSV-like tabular rows from a local safetensors language model.
This wrapper is intentionally thin. It keeps model choice, prompt budget, and parsing policy visible to the benchmark instead of hiding them behind a broad synthetic-data abstraction.
Attributes
| Name | Description |
|---|---|
base_model_path |
|
device |
|
do_sample |
|
examples |
|
load_in_4bit |
|
max_attempts |
|
max_new_tokens |
|
model_path |
|
params |
|
progress_path |
|
rows_per_prompt |
|
temperature |
|
tokenizer_path |
Methods
| Name | Description |
|---|---|
| fit | |
| sample | |
| summary | Print a summary of the model results. |
| to | Move all model parameters to specified device. |
fit
SafetensorsLLMInContextGenerator.fit(X, column_names=None)sample
SafetensorsLLMInContextGenerator.sample(n)summary
SafetensorsLLMInContextGenerator.summary()Print a summary of the model results.
to
SafetensorsLLMInContextGenerator.to(device)Move all model parameters to specified device.
Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| device | torch.device or str | Target device (‘cuda’, ‘cpu’, etc.) | required |
Returns
| Name | Type | Description |
|---|---|---|
| BaseEstimator | Self for method chaining |