Replies: 2 comments
-
Hi @andruhon! I'm Dosu and I’m helping the langchainjs team. The error happens because the HuggingFaceInference integration in LangChain.js always tries to use the "text-generation" task, but some providers (like "fireworks-ai") only support the "conversational" task for certain models (such as Recent updates allow specifying a If you need to use a model that only supports "conversational" with a specific provider, you’ll need to wait for LangChain.js to expose more advanced configuration, or try using a different model/provider combination that supports "text-generation" for your use case. To reply, just mention @dosu. How did I do? Good | Irrelevant | Incorrect | Verbose | Hallucination | Report 🐛 | Other |
Beta Was this translation helpful? Give feedback.
-
Thank you Dosubot. Just as a note: calling this with import { InferenceClient } from '@huggingface/inference';
const client = new InferenceClient(process.env.HUGGINGFACEHUB_API_KEY);
const out = await client.chatCompletion({
model: 'deepseek-ai/DeepSeek-R1',
messages: [{ role: 'user', content: 'What does JS stand for?' }],
max_tokens: 512,
});
console.log(out.choices[0].message); |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Checked other resources
Commit to Help
Example Code
Description
I am trying to figure out how to use huggingface with LangChain.js, but I have some difficulties with most models responding that they only have conversational type of tasks availab.
I had a look at dist, it ends up in InferenceClient.js of huggingface, which does not seem to have conversational in the list of tasks.
Mistrai here is just as an example, tried deepseek ai with the same outcome.
I searched for similar questions, but I didn't find the answer there, and also they are 2 years old already:
#3256
#2070
System Info
Beta Was this translation helpful? Give feedback.
All reactions