Skip to content

Commit 712ed1f

Browse files
committed
no api call to load task data in case of inference endpoints
1 parent 9b3e2cf commit 712ed1f

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

packages/inference/src/lib/makeRequestOptions.ts

+6
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,12 @@ export async function makeRequestOptions(
3535
if (maybeModel && isUrl(maybeModel)) {
3636
throw new Error(`Model URLs are no longer supported. Use endpointUrl instead.`);
3737
}
38+
39+
if (args.endpointUrl) {
40+
// No need to have maybeModel, or to load default model for a task
41+
return makeRequestOptionsFromResolvedModel(args.endpointUrl, args, options);
42+
}
43+
3844
if (!maybeModel && !task) {
3945
throw new Error("No model provided, and no task has been specified.");
4046
}

0 commit comments

Comments
 (0)