Huggingface.js: Step-by-Step Guide to Getting Started

Sdílet
Vložit
  • čas přidán 14. 05. 2023
  • #HuggingFace #MachineLearning #NLP
    Dive into the world of cutting-edge Natural Language Processing (NLP) with HuggingFace! As an open-source library, HuggingFace provides a collection of transformer-based models tailored for NLP tasks. Whether you're a seasoned data scientist or just getting started, HuggingFace offers a powerful, user-friendly platform for your machine learning and AI projects. Its robust API, extensive pre-trained model selection, and active community support make it an invaluable tool for any NLP endeavour. Start your journey with HuggingFace today and transform the way you work with language data.
  • Jak na to + styl

Komentáře • 59

  • @dannygamer9995
    @dannygamer9995 Před 17 dny +1

    Excellent and straight to the point, thank you.

  • @williamturner6876
    @williamturner6876 Před rokem +5

    This was absolutely excellent. Your style is simple and clear. Don't stop, you're a rare breed.

  • @ryanroman6589
    @ryanroman6589 Před rokem +5

    Keep pumping out these incredible videos my man!! Thank you!

  • @millermcdonell291
    @millermcdonell291 Před 5 měsíci +1

    short and simple, luv it

  • @JohnyIIOh
    @JohnyIIOh Před rokem +2

    Nice, exactly what I needed, gonna watch it next w/e

  • @hmtbt4122
    @hmtbt4122 Před rokem +2

    Thanks for sharing this. 😊

  • @sw-ln1hh
    @sw-ln1hh Před 7 měsíci +1

    thank you for your js ai content hands on programing video

  • @roiborromeo7921
    @roiborromeo7921 Před 2 měsíci +1

    This is definitely helpful.

  • @azzeddine1
    @azzeddine1 Před rokem +1

    Do you have a video that explains how to add ready-made templates to my WordPress site, for example?

    • @DevelopersDigest
      @DevelopersDigest  Před rokem

      I don’t but I can absolutely build some Wordpress examples. Stay tuned!

  • @priyacrypto
    @priyacrypto Před rokem +2

    Great video to kick off with HFJS, can you do 1 for using MPT-7B with nodejs

    • @DevelopersDigest
      @DevelopersDigest  Před rokem +2

      That’s a great idea, let me dig into this model. It sounds pretty compelling !

  • @ValeFero
    @ValeFero Před 2 měsíci

    How do I display the result to the html code. I keep getting the error document not defined, since it's node and not browser.

  • @user-we4wm4xu7g
    @user-we4wm4xu7g Před 9 měsíci +1

    Thanks for the video! For scalability, I would need to deploy a huggingface inference API from a model of my choosing right? I think in this case, its using free resources for playgrounding?

  • @karamjittech
    @karamjittech Před 11 měsíci

    Great video. How would you train the model for few specific tasks? By using API, they will also charge..yes?

    • @DevelopersDigest
      @DevelopersDigest  Před 11 měsíci

      There are free tiers as well as paid tiers for using their inference apis. To train a model would be a bit longer to explain then a comment block. I will be making a video on training models coming in future videos! Stay tuned

  • @elleryfamilia8291
    @elleryfamilia8291 Před 11 měsíci +1

    What's unclear for me at the moment is, is the HF library just downloading the models at runtime and running them locally? Are all the models already embedded in the HF library? If I use an LLM from HF, does it download it and run it locally? Does HF provide any sort of hosting or is it just a model repo?

    • @DevelopersDigest
      @DevelopersDigest  Před 11 měsíci +1

      1. You can set up hugging face to download models and run locally. If interested in doing that with js, check out transformers.js on HF
      2. Not all models are embedded in HF library, it’s mostly open source models with varying permissions on how you can use them for your applications. For example, if you want to build a commercial app, make sure to check the license first as an example.
      3. If you use an LLM from HF does it download and run it locally, you can choose to do that if you have the hardware to run the selected model you can run local or choose to deploy on the cloud, which in some case you might not have any other option. With that said some models are available for inference which you can access from an API which is what I demonstrate here with Huggingface.js. You can choose to host a model from hugging face and have billing directly through HF, those models will be hosted on cloud infrastructure like aws, azure, gcp. huggingface.co/inference-endpoints
      I hope that helps !

  • @froggy472
    @froggy472 Před 3 měsíci

    Thanks for such amazing video, I love.
    have you faced this issue before ?
    `Error: Authorization header is correct, but the token seems invalid`
    do I need to regitster the billing information first ?

    • @froggy472
      @froggy472 Před 3 měsíci

      this is full error.
      file:///Users/usr/Documents/hugging_face/node_modules/@huggingface/inference/dist/index.js:169
      throw new Error(output.error);
      ^
      Error: unknown error
      at request (file:///Users/froggy/Documents/hugging_face/node_modules/@huggingface/inference/dist/index.js:169:15)
      at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
      at async textGeneration (file:///Users/froggy/Documents/hugging_face/node_modules/@huggingface/inference/dist/index.js:655:15)
      at async file:///Users/froggy/Documents/hugging_face/huggingface.js:16:1

  • @sahilsaini9976
    @sahilsaini9976 Před 5 měsíci +1

    This gives me error for the fisrt import line. Plz help me with this...

  • @TirthRadadiya-hp9sq
    @TirthRadadiya-hp9sq Před 5 měsíci +1

    I have tried this for img2img models but I am unable to get back image result. Can you tell me what could I do to get image?

    • @DevelopersDigest
      @DevelopersDigest  Před 5 měsíci

      You may have to write the result of the image to disk or to something like an S3 bucket or equivalent. I would have to take a look at what the particular model returns! Hopefully this helps!

  • @hmtbt4122
    @hmtbt4122 Před rokem +2

    sir its a request to please upload the code on the repo you provided previously. it would be very helpful sir

    • @DevelopersDigest
      @DevelopersDigest  Před rokem +1

      Hi Hemant, which video are you referring to? 🙂

    • @hmtbt4122
      @hmtbt4122 Před rokem

      @@DevelopersDigest code of the previous videos like DALL-E: A Full Stack OpenAI Image Gallery App and if posiible Full-Stack App 💻 w/ React 💬, OpenAI, Express 🤖, Node 💾, DALLE 🧠 & GPT-3 🤖 this also sir,

  • @SD-rg5mj
    @SD-rg5mj Před 11 měsíci +1

    hello, I would like the text generated by hugging face, when I make images to text, to go directly into a cell of my Google sheet,
    can we copy and paste our 10-digit pay keys into my Google sheets like I do with chat gpt?
    anyway thank you very much for your videos

    • @DevelopersDigest
      @DevelopersDigest  Před 11 měsíci

      You could leverage the google sheets api to do this!

    • @SD-rg5mj
      @SD-rg5mj Před 10 měsíci

      @DevelopersDigest ok thank you very much for your answer can you suggest me a tutorial for someone like me who doesn't know anything about code
      otherwise I saw a tutorial to learn how to use chatgpt directly in Google sheet, without touching the code, just with the chatgpt API and a Google sheet module,
      but all this is with text,
      do you think i can ask chatgpt to describe the images that are in my google sheet
      anyway thank you very much for your answer

  • @OPGAMING-rd3qu
    @OPGAMING-rd3qu Před 11 měsíci +1

    One day you have 10million subs

    • @DevelopersDigest
      @DevelopersDigest  Před 11 měsíci

      I won’t believe it if I make it to 10,000! Thank you 🙏

  • @aakashkhamaru9403
    @aakashkhamaru9403 Před 5 měsíci +1

    I need a model that could convert text into mongodb queries, I have searched huggingface but could not find such a model. Could anyone help me?

    • @DevelopersDigest
      @DevelopersDigest  Před 5 měsíci

      Check out python.langchain.com/docs/use_cases/sql/
      Langchain might be able to help, I am not sure if there is a mongodb equivalent but using a framework like langchain + a model could help you accomplish what you are looking for - cheers 🥂

  • @x_game_x
    @x_game_x Před 5 měsíci +1

    Please do a video on image to image

    • @DevelopersDigest
      @DevelopersDigest  Před 5 měsíci

      Thank you for the suggestion. What sort of image to image generation did you have in mind?

    • @aricwilliamsdeveloper
      @aricwilliamsdeveloper Před 5 měsíci

      upload two images and combine them... also how can i deploy to server @@DevelopersDigest

  • @shreerajshinde9715
    @shreerajshinde9715 Před 4 měsíci +1

    Can we use huggingfac embeddings

  • @askcoachmarty
    @askcoachmarty Před 11 měsíci +1

    Love your videos. The format of starting with the outline and dropping the code in underneath is brilliant in its simplicity. I like the javascript examples. Have you used langchain with huggingface to retrieve information from a vectordb? I used this czcams.com/video/vpU_6x3jowg/video.html to create embeddings in Pinecone and I'm trying to convert the client to query it. Be happy to share the working code once it's complete. Any pointers to code or advice are welcomed! have fun!

    • @DevelopersDigest
      @DevelopersDigest  Před 11 měsíci +1

      Cheers thank you. If you are interested, I have used pinecone in my video here: m.czcams.com/video/CF5buEVrYwo/video.html

    • @askcoachmarty
      @askcoachmarty Před 11 měsíci

      @@DevelopersDigest Thanks! I'll go check it out...

    • @askcoachmarty
      @askcoachmarty Před 11 měsíci

      In case anybody comes back to read this thread. I had to create a HuggingFaceInferenceEmbeddings for the model: "sentence-transformers/multi-qa-mpnet-base-dot-v1" to match the pinecone index. Then I used Langchain's Pinecone wrappers and did a vectorStore.similaritySearch, and everything worked great. (haha - like that explanation? now you see why we like the way you explain things ;) )

  • @justin9494
    @justin9494 Před 9 měsíci +1

    Is it possible to get the "returnTimestamps: true" of whisper model with HuggingfaceJS inference API? I'm transcribing speech and I want it to return with timestamps. It seems that it's compatible with python, so I thought it is too for javascript. This is what I have now.
    const transcriptionResult = await hf.automaticSpeechRecognition({
    model: 'openai/whisper-base',
    data: fs.readFileSync(chunkPath),
    //@ts-ignore
    parameters: {
    return_timestamps: true //this does not work. It says that parameters does not exist in automaticSpeechRecognition
    }
    });
    I can't switch to python as my backend heavily depends in nodejs. I can't figure out how to do this, I've looked in the documentation, and it seems like inference api is not that good yet. Thank you!

    • @DevelopersDigest
      @DevelopersDigest  Před 9 měsíci

      I am not familiar whether the whisper base supports timestamps. If you have a working example of it working through Huggingface, my thought would be to log out the payload in your Python request and ensure the same payload is being sent. I have only used whisper directly through OpenAIs API so I am not familiar with this the hf implementation, sorry! 😞

  • @Sagan1995
    @Sagan1995 Před rokem +1

    I did everything like you did in the video, but I can't use many of the models available. When I try to use the summarization model, I get the following error: Error: Could not load model facebook/bart-large-cnn with any of the following classes: (, ).
    at request (file:///C:/Users/user/Desktop/hugging/node_modules/@huggingface/inference/dist/index.mjs:106:15)

    • @DevelopersDigest
      @DevelopersDigest  Před 11 měsíci

      The inference model free tier does have limits, with that said if you are trying to run models locally it is a bit more involved. You’ll have to make sure everything is installed and downloaded accordingly! Cheers !

  • @anasosama7558
    @anasosama7558 Před 5 měsíci +1

    Too technical for me 🫤

    • @DevelopersDigest
      @DevelopersDigest  Před 5 měsíci

      I can absolutely appreciate that - I think it should only be getting easier in time! Cheers