@huggingface/inference
Version:
Typescript client for the Hugging Face Inference Providers and Inference Endpoints
34 lines (33 loc) • 1.57 kB
JavaScript
;
/**
* See the registered mapping of HF model ID => Cerebras model ID here:
*
* https://huggingface.co/api/partners/cerebras/models
*
* This is a publicly available mapping.
*
* If you want to try to run inference for a new model locally before it's registered on huggingface.co,
* you can add it to the dictionary "HARDCODED_MODEL_ID_MAPPING" in consts.ts, for dev purposes.
*
* - If you work at Cerebras and want to update this mapping, please use the model mapping API we provide on huggingface.co
* - If you're a community member and want to add a new supported HF model to Cerebras, please open an issue on the present repo
* and we will tag Cerebras team members.
*
* Thanks!
*/
Object.defineProperty(exports, "__esModule", { value: true });
exports.CerebrasConversationalTask = void 0;
const omit_js_1 = require("../utils/omit.js");
const providerHelper_js_1 = require("./providerHelper.js");
class CerebrasConversationalTask extends providerHelper_js_1.BaseConversationalTask {
constructor() {
super("cerebras", "https://api.cerebras.ai");
}
preparePayload(params) {
// Cerebras strictly validates request bodies and rejects the OpenAI-proprietary `store`
// param with a 400 (`{"code":"wrong_api_format"}`). It has no meaning outside of OpenAI's
// own API, so drop it before forwarding rather than surfacing a spurious error to callers.
return (0, omit_js_1.omit)(super.preparePayload(params), "store");
}
}
exports.CerebrasConversationalTask = CerebrasConversationalTask;