[Python] using pipelines with a local model

Discussão em 'Python' iniciado por Stack, Setembro 28, 2024.

  1. Stack

    Stack Membro Participativo

    I am trying to use a simple pipeline offline. I am only allowed to download files directly from the web.

    I went to https://huggingface.co/distilbert-base-uncased-finetuned-sst-2-english/tree/main and downloaded all the files in a local folder C:\\Users\\me\\mymodel

    However, when I tried to load the model I get a strange error

    from transformers import pipeline

    classifier = pipeline(task= 'sentiment-analysis',
    model= "C:\\Users\\me\\mymodel",
    tokenizer = "C:\\Users\\me\\mymodel")

    ValueError: unable to parse C:\Users\me\mymodel\modelcard.json as a URL or as a local path


    What is the issue here?

    Continue reading...

Compartilhe esta Página