Hugging Face Transformers React - v1.2.0
    Preparing search index...

    Function useTransformers

    • Hook to access the Transformers and WebLLM context. Must be used within a TransformersProvider.

      Returns TransformersContextValue

      Context value containing all Transformers.js and WebLLM functionality

      Error if used outside of TransformersProvider

      function MyComponent() {
      const {
      libraryStatus,
      analyzeSentiment,
      // WebLLM features
      isWebLLMLoaded,
      chatCompletion,
      getAvailableWebLLMModels
      } = useTransformers();

      return <div>Status: {libraryStatus}</div>;
      }