@huggingface/inference 3.6.1 → 3.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +0 -25
- package/dist/index.cjs +256 -154
- package/dist/index.js +256 -154
- package/dist/src/config.d.ts +1 -0
- package/dist/src/config.d.ts.map +1 -1
- package/dist/src/lib/makeRequestOptions.d.ts.map +1 -1
- package/dist/src/providers/black-forest-labs.d.ts.map +1 -1
- package/dist/src/providers/cerebras.d.ts.map +1 -1
- package/dist/src/providers/cohere.d.ts.map +1 -1
- package/dist/src/providers/fal-ai.d.ts +6 -16
- package/dist/src/providers/fal-ai.d.ts.map +1 -1
- package/dist/src/providers/fireworks-ai.d.ts.map +1 -1
- package/dist/src/providers/hf-inference.d.ts.map +1 -1
- package/dist/src/providers/hyperbolic.d.ts.map +1 -1
- package/dist/src/providers/nebius.d.ts.map +1 -1
- package/dist/src/providers/novita.d.ts.map +1 -1
- package/dist/src/providers/openai.d.ts.map +1 -1
- package/dist/src/providers/replicate.d.ts.map +1 -1
- package/dist/src/providers/sambanova.d.ts.map +1 -1
- package/dist/src/providers/together.d.ts.map +1 -1
- package/dist/src/tasks/audio/automaticSpeechRecognition.d.ts.map +1 -1
- package/dist/src/tasks/custom/request.d.ts +1 -0
- package/dist/src/tasks/custom/request.d.ts.map +1 -1
- package/dist/src/tasks/custom/streamingRequest.d.ts +1 -0
- package/dist/src/tasks/custom/streamingRequest.d.ts.map +1 -1
- package/dist/src/tasks/cv/imageToText.d.ts.map +1 -1
- package/dist/src/tasks/cv/objectDetection.d.ts +1 -1
- package/dist/src/tasks/cv/objectDetection.d.ts.map +1 -1
- package/dist/src/tasks/cv/textToVideo.d.ts +1 -1
- package/dist/src/tasks/cv/textToVideo.d.ts.map +1 -1
- package/dist/src/tasks/cv/zeroShotImageClassification.d.ts +1 -1
- package/dist/src/tasks/cv/zeroShotImageClassification.d.ts.map +1 -1
- package/dist/src/tasks/multimodal/documentQuestionAnswering.d.ts +1 -1
- package/dist/src/tasks/multimodal/documentQuestionAnswering.d.ts.map +1 -1
- package/dist/src/tasks/multimodal/visualQuestionAnswering.d.ts.map +1 -1
- package/dist/src/tasks/nlp/chatCompletion.d.ts +1 -1
- package/dist/src/tasks/nlp/chatCompletion.d.ts.map +1 -1
- package/dist/src/tasks/nlp/chatCompletionStream.d.ts +1 -1
- package/dist/src/tasks/nlp/chatCompletionStream.d.ts.map +1 -1
- package/dist/src/tasks/nlp/questionAnswering.d.ts.map +1 -1
- package/dist/src/tasks/nlp/sentenceSimilarity.d.ts.map +1 -1
- package/dist/src/tasks/nlp/textClassification.d.ts.map +1 -1
- package/dist/src/tasks/nlp/tokenClassification.d.ts.map +1 -1
- package/dist/src/tasks/nlp/zeroShotClassification.d.ts.map +1 -1
- package/dist/src/types.d.ts +11 -2
- package/dist/src/types.d.ts.map +1 -1
- package/dist/src/utils/request.d.ts +27 -0
- package/dist/src/utils/request.d.ts.map +1 -0
- package/dist/test/InferenceClient.spec.d.ts.map +1 -1
- package/package.json +2 -2
- package/src/config.ts +1 -0
- package/src/lib/makeRequestOptions.ts +8 -3
- package/src/providers/black-forest-labs.ts +6 -2
- package/src/providers/cerebras.ts +6 -2
- package/src/providers/cohere.ts +6 -2
- package/src/providers/fal-ai.ts +85 -3
- package/src/providers/fireworks-ai.ts +6 -2
- package/src/providers/hf-inference.ts +6 -2
- package/src/providers/hyperbolic.ts +6 -2
- package/src/providers/nebius.ts +6 -2
- package/src/providers/novita.ts +5 -2
- package/src/providers/openai.ts +6 -2
- package/src/providers/replicate.ts +6 -2
- package/src/providers/sambanova.ts +6 -2
- package/src/providers/together.ts +6 -2
- package/src/snippets/templates.exported.ts +1 -1
- package/src/tasks/audio/audioClassification.ts +2 -2
- package/src/tasks/audio/audioToAudio.ts +2 -2
- package/src/tasks/audio/automaticSpeechRecognition.ts +3 -3
- package/src/tasks/audio/textToSpeech.ts +2 -2
- package/src/tasks/custom/request.ts +7 -32
- package/src/tasks/custom/streamingRequest.ts +5 -85
- package/src/tasks/cv/imageClassification.ts +2 -2
- package/src/tasks/cv/imageSegmentation.ts +2 -2
- package/src/tasks/cv/imageToImage.ts +2 -2
- package/src/tasks/cv/imageToText.ts +7 -9
- package/src/tasks/cv/objectDetection.ts +4 -4
- package/src/tasks/cv/textToImage.ts +3 -3
- package/src/tasks/cv/textToVideo.ts +23 -36
- package/src/tasks/cv/zeroShotImageClassification.ts +4 -5
- package/src/tasks/multimodal/documentQuestionAnswering.ts +13 -13
- package/src/tasks/multimodal/visualQuestionAnswering.ts +4 -2
- package/src/tasks/nlp/chatCompletion.ts +3 -4
- package/src/tasks/nlp/chatCompletionStream.ts +3 -3
- package/src/tasks/nlp/featureExtraction.ts +2 -2
- package/src/tasks/nlp/fillMask.ts +2 -2
- package/src/tasks/nlp/questionAnswering.ts +3 -2
- package/src/tasks/nlp/sentenceSimilarity.ts +2 -11
- package/src/tasks/nlp/summarization.ts +2 -2
- package/src/tasks/nlp/tableQuestionAnswering.ts +2 -2
- package/src/tasks/nlp/textClassification.ts +8 -9
- package/src/tasks/nlp/textGeneration.ts +16 -16
- package/src/tasks/nlp/textGenerationStream.ts +2 -2
- package/src/tasks/nlp/tokenClassification.ts +9 -10
- package/src/tasks/nlp/translation.ts +2 -2
- package/src/tasks/nlp/zeroShotClassification.ts +9 -10
- package/src/tasks/tabular/tabularClassification.ts +2 -2
- package/src/tasks/tabular/tabularRegression.ts +2 -2
- package/src/types.ts +13 -2
- package/src/utils/request.ts +161 -0
package/README.md
CHANGED
|
@@ -572,31 +572,6 @@ await hf.tabularClassification({
|
|
|
572
572
|
})
|
|
573
573
|
```
|
|
574
574
|
|
|
575
|
-
## Custom Calls
|
|
576
|
-
|
|
577
|
-
For models with custom parameters / outputs.
|
|
578
|
-
|
|
579
|
-
```typescript
|
|
580
|
-
await hf.request({
|
|
581
|
-
model: 'my-custom-model',
|
|
582
|
-
inputs: 'hello world',
|
|
583
|
-
parameters: {
|
|
584
|
-
custom_param: 'some magic',
|
|
585
|
-
}
|
|
586
|
-
})
|
|
587
|
-
|
|
588
|
-
// Custom streaming call, for models with custom parameters / outputs
|
|
589
|
-
for await (const output of hf.streamingRequest({
|
|
590
|
-
model: 'my-custom-model',
|
|
591
|
-
inputs: 'hello world',
|
|
592
|
-
parameters: {
|
|
593
|
-
custom_param: 'some magic',
|
|
594
|
-
}
|
|
595
|
-
})) {
|
|
596
|
-
...
|
|
597
|
-
}
|
|
598
|
-
```
|
|
599
|
-
|
|
600
575
|
You can use any Chat Completion API-compatible provider with the `chatCompletion` method.
|
|
601
576
|
|
|
602
577
|
```typescript
|