Coder Social home page Coder Social logo

Comments (10)

sciencecw avatar sciencecw commented on August 26, 2024

These are probably the offending parts
https://github.com/jxmorris12/vec2text/blob/master/vec2text/models/inversion.py#L173

https://github.com/jxmorris12/vec2text/blob/master/vec2text/models/inversion.py#L193-L198

from vec2text.

jxmorris12 avatar jxmorris12 commented on August 26, 2024

Thanks; I'll look into it. In the meantime, I've trained a decent inversion model using almost exactly these settings, which is available here: https://huggingface.co/jxm/sentence-transformers_all-MiniLM-L6-v2__msmarco__128

from vec2text.

jxmorris12 avatar jxmorris12 commented on August 26, 2024

I ran this command and it worked fine for me

from vec2text.

jxmorris12 avatar jxmorris12 commented on August 26, 2024

I'm on an Apple M1

from vec2text.

sciencecw avatar sciencecw commented on August 26, 2024

It ran after I uncommented this line
https://github.com/jxmorris12/vec2text/blob/master/vec2text/models/inversion.py#L173

from vec2text.

sciencecw avatar sciencecw commented on August 26, 2024

Also M1 Mac...

from vec2text.

sciencecw avatar sciencecw commented on August 26, 2024

Silly question: how do you use the trained inverter with your repo?
https://huggingface.co/jxm/sentence-transformers_all-MiniLM-L6-v2__msmarco__128

from vec2text.

sciencecw avatar sciencecw commented on August 26, 2024

I commented out a few lines so that I can use load_corrector with other models

import vec2text
corrector = vec2text.load_corrector("jxm/sentence-transformers_all-MiniLM-L6-v2__msmarco__128")
vec2text.invert_strings(
    [
        "Jack Morris is a PhD student at Cornell Tech in New York City",
        "It was the best of times, it was the worst of times, it was the age of wisdom, it was the age of foolishness, it was the epoch of belief, it was the epoch of incredulity"
    ],
    corrector=corrector,
)

The model returns:

["Yes, I'm playing the Weightless Option with the help of the Tiny Cells. I'm playing the Weightless Option with the help of the Tiny Cells. I'm growing older.",
 'I have tried the following: 1. I have tried the following: 2. I have tried the following: 3. I have tried the following: 4. I have tried the following: 5. I have tried the following: 6. I have tried the following: 7. I have tried the following: 8. I have tried the following: 9. I have tried the following: 10. I have tried the following: 11. I have tried the following: 12. I have tried the following: 13. I have tried the following: 14. I have tried the following: 15. I have tried the following: 16. I have tried the following: 17. I have tried the following: 18. I']

and when I set num_steps, it gives AssertionError on this line
assert embedding.shape == (batch_size, self.embedder_dim)

from vec2text.

jxmorris12 avatar jxmorris12 commented on August 26, 2024

I'll get back to you. You can't use it that way though. Basically I haven't trained the expensive corrector model, only have the zero-step inversion model for this specific model, so the API way won't work properly.

from vec2text.

christophschuhmann avatar christophschuhmann commented on August 26, 2024

I'll get back to you. You can't use it that way though. Basically I haven't trained the expensive corrector model, only have the zero-step inversion model for this specific model, so the API way won't work properly.

Can you add documentation please?

How to use it:)

from vec2text.

Related Issues (20)

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.