Transformers
Installation
You need to install transformers
and torch
to use this in blendsql.
TransformersLLM
Bases: ConstrainedModel
Class for Transformers local Model.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
model_name_or_path
|
str
|
Name of the model on HuggingFace, or the path to a local model |
required |
caching
|
bool
|
Bool determining whether we access the model's cache |
True
|
Examples:
from blendsql.models import TransformersLLM
model = TransformersLLM("Qwen/Qwen1.5-0.5B")
Source code in blendsql/models/constrained/guidance.py
71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 |
|