Code Monkey home page Code Monkey logo

transformers_jittor's People

Contributors

aaugustin avatar amyeroberts avatar anton-l avatar arthurzucker avatar daspartho avatar dependabot[bot] avatar erenup avatar gante avatar jplu avatar julien-c avatar lukovnikov avatar lysandrejik avatar mfuntowicz avatar mrm8488 avatar narsil avatar nielsrogge avatar patil-suraj avatar patrickvonplaten avatar rlouf avatar rocketknight1 avatar sanchit-gandhi avatar sgugger avatar sshleifer avatar stas00 avatar stefan-it avatar stevhliu avatar thomwolf avatar victorsanh avatar ydshieh avatar younesbelkada avatar

Watchers

 avatar  avatar

Forkers

jittorrepos

transformers_jittor's Issues

How to use the BLIP model?

I'm a jittor beginner, now I need to use the BLIP in transformers_jittor. I have tried the example code in transformers_jittor/src/transformers/models/blip/modeling_blip.py, line 973~992 :

        r"""
        Returns:

        Examples:

        ```python
        >>> from PIL import Image
        >>> import requests
        >>> from transformers import AutoProcessor, BlipForConditionalGeneration

        >>> processor = AutoProcessor.from_pretrained("Salesforce/blip-image-captioning-base")
        >>> model = BlipForConditionalGeneration.from_pretrained("Salesforce/blip-image-captioning-base")

        >>> url = "http://images.cocodataset.org/val2017/000000039769.jpg"
        >>> image = Image.open(requests.get(url, stream=True).raw)

        >>> inputs = processor(images=image, return_tensors="pt")

        >>> outputs = model(**inputs)
        ```"""

But it can't work, some Errors occurs:

Traceback (most recent call last):
  File "try.py", line 53, in <module>
    model = BlipForConditionalGeneration.from_pretrained("Salesforce/blip-image-captioning-base")
  File "/home/user/anaconda3/envs/jittor/lib/python3.9/site-packages/transformers/modeling_utils.py", line 2370, in from_pretrained
    model = cls(config, *model_args, **model_kwargs)
  File "/home/user/anaconda3/envs/jittor/lib/python3.9/site-packages/transformers/models/blip/modeling_blip.py", line 950, in __init__
    self.text_decoder = BlipTextLMHeadModel(config.text_config)
  File "/home/user/anaconda3/envs/jittor/lib/python3.9/site-packages/transformers/models/blip/modeling_blip_text.py", line 812, in __init__
    self.bert = BlipTextModel(config, add_pooling_layer=False)
  File "/home/user/anaconda3/envs/jittor/lib/python3.9/site-packages/transformers/models/blip/modeling_blip_text.py", line 578, in __init__
    self.embeddings = BlipTextEmbeddings(config)
  File "/home/user/anaconda3/envs/jittor/lib/python3.9/site-packages/transformers/models/blip/modeling_blip_text.py", line 60, in __init__
    self.register_buffer("position_ids", torch.arange(config.max_position_embeddings).expand((1, -1)))
  File "/home/user/anaconda3/envs/jittor/lib/python3.9/site-packages/jittor/misc.py", line 299, in expand
    shape[i] = x.shape[i]
RuntimeError: Wrong inputs arguments, Please refer to examples(help(jt.NanoVector.__map_getitem__)).

Types of your inputs are:
 self   = NanoVector,
 arg0   = int,

The function declarations are:
 inline int64 at(int i)
 inline NanoVector slice(Slice slice)

Failed reason:[f 0514 20:59:42.756720 96 nano_vector.h:116] Check failed: i>=0 && i<size()  Something wrong... Could you please report this issue?

How can I solve this problem? Thx for your patience!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.