Bad request: Task not found for this model

I’m trying to use HF API for inference using NodeJS SDK. So far, I’m on the free tier but will be happy to pay if required. I’m interested in a few models that are not really popular but they support the Lithuanian language which is important to me.

The problem is that I’m getting “Bad request: Task not found for this model” error.

Here’s my code:

        const result = await inference.textGeneration({
            model: "neurotechnology/Lt-Llama-2-13b-instruct-hf",
            inputs: prompt,
            parameters: {
                temperature: 0,
            }
        });
        return result.generated_text;
1 Like

At present, the free Inference API for HF is not available for minor models, but of course it can be used without a problem from the Endpoint API or other companies’ cloud services.

As for the model in question, it seems that the README.md is not set up properly, and the Task is literally unknown. I think it will work properly if there is a line like the following in the top of README.md.

---
pipeline_tag: text-generation
library_name: transformers
---

Please contact the author via the Discussion section of the model.

1 Like

Thank you very much for the clarification!

Can you elaborate on how I can use the Endpoint API? I assumed that what I used (see my code) was exactly that.

1 Like

You’re right. It seems that the way to use the Inference API and Endpoint API is the same in this case. As a last resort, you could copy the repo and modify it yourself, and it would probably work, but it might not be good from a licensing perspective…:sweat_smile:
It would be easy to run it locally using the local GPU power, but that’s a bit different… Maybe you should let the author know or look for a different model.

1 Like

This topic was automatically closed 12 hours after the last reply. New replies are no longer allowed.