Skip to content

Commit b2aff1d

Browse files
committed
fix: add warnings for model opts for hf intrinsics
1 parent 1e5d17d commit b2aff1d

File tree

3 files changed

+6
-11
lines changed

3 files changed

+6
-11
lines changed

mellea/backends/huggingface.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -251,6 +251,11 @@ async def _generate_from_intrinsic(
251251
if not ctx.is_chat_context:
252252
raise Exception("Does not yet support non-chat contexts.")
253253

254+
if len(model_options.items()) > 0:
255+
FancyLogger.get_logger().info(
256+
"passing in model options when generating with an adapter; some model options may be overwritten / ignored"
257+
)
258+
254259
linearized_ctx = ctx.view_for_generation()
255260
assert linearized_ctx is not None, (
256261
"If ctx.is_chat_context, then the context should be linearizable."
@@ -316,11 +321,6 @@ async def _generate_from_intrinsic(
316321
for model_option in model_options:
317322
if model_option == ModelOption.TEMPERATURE:
318323
request_json["temperature"] = model_options[model_option]
319-
else:
320-
raise ValueError(
321-
f"Model option '{model_option}' not implemented "
322-
f"on this generation code path."
323-
)
324324

325325
rewritten = rewriter.transform(request_json, **action.intrinsic_kwargs)
326326

mellea/backends/openai.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -440,11 +440,6 @@ async def _generate_from_intrinsic(
440440
for model_option in model_options:
441441
if model_option == ModelOption.TEMPERATURE:
442442
request_json["temperature"] = model_options[model_option]
443-
else:
444-
raise ValueError(
445-
f"Model option '{model_option}' not implemented "
446-
f"on this generation code path."
447-
)
448443

449444
rewritten = rewriter.transform(request_json, **action.intrinsic_kwargs)
450445

mellea/stdlib/intrinsics/rag.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,8 @@ def _call_intrinsic(
6464
intrinsic,
6565
context,
6666
backend,
67-
# No rejection sampling, please
6867
model_options={ModelOption.TEMPERATURE: 0.0},
68+
# No rejection sampling, please
6969
strategy=None,
7070
)
7171

0 commit comments

Comments
 (0)