Giter Club home page Giter Club logo

Comments (4)

bakks avatar bakks commented on August 22, 2024 1

Ok this should be fixed now in the v0.1.4 release - I definitely misunderstood the issue initially, thanks for investigating @bhazzard

from butterfish.

bakks avatar bakks commented on August 22, 2024

Hey @tompflynn - thanks for creating an issue, sorry this isn't working as expected. I'm going to try to reproduce the error right now.

One theory I have about the shell problem is that this code added recently is causing the problem. If that's the case a workaround would be to try running butterfish shell -p'' to see if that makes a difference.

Something that would be helpful - what's in your .bashprofile or .profile? I haven't seen anything like this on a handful of different shells so I'm wondering if there's some more custom/esoteric setup happening.

from butterfish.

bakks avatar bakks commented on August 22, 2024

Spun up a NixOS, wasn't able to replicate. My best guess is there's something a bit custom going on in a file that bash is loading like .bashprofile or .profile.

from butterfish.

bhazzard avatar bhazzard commented on August 22, 2024

To show what the ux seems to be on Mac using zsh...

Loading the index seems to work as expected

$ butterfish loadindex .

Loading indexes (not generating new embeddings) for .
Loaded 56 files

...But asking a question fails, claiming no index is loaded

butterfish indexquestion "is this working?"

Error: No vector index loaded

... Interestingly, indexsearch works just fine

butterfish indexsearch "is this working?"

/butterfish_index_test/testfile.txt : 0.8021
test content to diagnose index issue on Mac

...A quick look at the code

That error message in indexquestion comes from: https://github.com/bakks/butterfish/blob/f790d7d0aeb8e6520837b61ba7bfe40b53570697/butterfish/commands.go#L362-L364C4

  if this.VectorIndex == nil {
          return errors.New("No vector index loaded")
  }

...comparing the working command indexsearch with indexquestion

We can see that the first thing the indexsearch command (which works) does is this.initVectorIndex(nil), whereas indexquestion command seems to skip this step. My guess is that this is the culprit. But why would this work for some folks?

... but when I make that change (add this.initVectorIndex(nil)), I get a new error

Error: Incorrect number of fields provided, prompt question requires fields ({filename}, {snippets}, {question})

This comes from:

// check that the number of fields matches the number of arguments
if len(fields)*2 != len(args) {
fieldNames := strings.Join(fields, ", ")
return "", fmt.Errorf("Incorrect number of fields provided, prompt %s requires fields (%s)", prompt.Name, fieldNames)
}

// check that the number of fields matches the number of arguments
if len(fields)*2 != len(args) {
        fieldNames := strings.Join(fields, ", ")
        return "", fmt.Errorf("Incorrect number of fields provided, prompt %s requires fields (%s)", prompt.Name, fieldNames)
}

When it is trying to load the prompt for "question".

from butterfish.

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.