Giter Club home page Giter Club logo

Comments (11)

filip-halt avatar filip-halt commented on May 23, 2024 1

@nkeilar Did you set the environment variable MILVUS_COLLECTION? The script directly connects to the vector store, it doesn't use the poetry server. I just tested it and it worked. If the collection isn't set, the server will run on its own uuid named collection and the script will push data into another uuid named collection.

from chatgpt-retrieval-plugin.

nkeilar avatar nkeilar commented on May 23, 2024

This could be related with #51

from chatgpt-retrieval-plugin.

CyberAmyntas avatar CyberAmyntas commented on May 23, 2024

Could you add a filter to the query and try again?

{
  "queries": [
    {
      "query": "string,
      "filter": {
        "source": "file"
      },
      "top_k": 3
    }
  ]
}

Also, check the zip and extracted docs are adding the right source type, like #32

from chatgpt-retrieval-plugin.

CyberAmyntas avatar CyberAmyntas commented on May 23, 2024

Could you add a filter to the query and try again?

{
  "queries": [
    {
      "query": "string,
      "filter": {
        "source": "file"
      },
      "top_k": 3
    }
  ]
}

Also, check the zip and extracted docs are adding the right source type, like #32

from chatgpt-retrieval-plugin.

nkeilar avatar nkeilar commented on May 23, 2024

Pulled latest changes and retested, not working as I would expect (no results). I tried changing the query string to all sorts of things like "This is an example markdown document", "example" etc. No dice. Not getting any results.

Import process

$ python process_zip.py --filepath example.zip --screen_for_pii False --extract_metadata True
Attempting creation of Milvus default index
Creation of Milvus default index successful
Processed 0 documents
Error processing dump/__MACOSX/example/._document.pdf: EOF marker not found
Processed 0 documents
Error processing dump/__MACOSX/example/._Untitled presentation.pptx: File is not a zip file
Processed 0 documents
Error processing dump/__MACOSX/example/._document.txt: 'utf-8' codec can't decode byte 0xc8 in position 99: invalid continuation byte
Processed 0 documents
Error processing dump/__MACOSX/example/._document.docx: File is not a zip file
Processed 0 documents
extracted_text from dump/example/document.md
Completion: False.
Completion: {
  "source": "file"
}
completion: {
  "source": "file"
}
extracted_text from dump/example/document.docx
Completion: False
Completion: {
  "source": "file",
  "source_id": "document.docx"
}
completion: {
  "source": "file",
  "source_id": "document.docx"
}
extracted_text from dump/example/Untitled presentation.pptx
Completion: False.
Completion: {
  "source": "file",
  "source_id": "Untitled presentation.pptx"
}
completion: {
  "source": "file",
  "source_id": "Untitled presentation.pptx"
}
extracted_text from dump/example/document.pdf
Completion: False.
Completion: {
  "source": "file",
  "source_id": "document.pdf"
}
completion: {
  "source": "file",
  "source_id": "document.pdf"
}
extracted_text from dump/example/document.txt
Completion: False
Completion: {
  "source": "file",
  "source_id": "document.txt"
}
completion: {
  "source": "file",
  "source_id": "document.txt"
}
Upserting batch of 5 documents, batch 0
documents:  [Document(id='c43736b3-bc20-4bdd-af07-bcb4475fe246', text='This is an example markdown document\n', metadata=DocumentMetadata(source=<Source.file: 'file'>, source_id=None, url=None, created_at=None, author=None)), Document(id='8f413ca9-2bfe-4d82-90b1-cf51d52da048', text='This is a test word document', metadata=DocumentMetadata(source=<Source.file: 'file'>, source_id='document.docx', url=None, created_at=None, author=None)), Document(id='7bfbaf13-6004-43d0-9725-1176e0590578', text='This is an example Powerpoint \n', metadata=DocumentMetadata(source=<Source.file: 'file'>, source_id='Untitled presentation.pptx', url=None, created_at=None, author=None)), Document(id='47249c96-2e69-4e5a-94e2-d26d45901f1b', text='T h i s\ni s\na\nt e s t\nP D F\nd o c u m e n t', metadata=DocumentMetadata(source=<Source.file: 'file'>, source_id='document.pdf', url=None, created_at=None, author=None)), Document(id='7af3a67a-ba93-4884-81eb-011e9321cb45', text='\ufeffThis is a test plaintext document', metadata=DocumentMetadata(source=<Source.file: 'file'>, source_id='document.txt', url=None, created_at=None, author=None))]
Upserting batch of size 5
Upserted batch successfully
Skipped 4 files due to errors or PII detection
dump/__MACOSX/example/._document.pdf
dump/__MACOSX/example/._Untitled presentation.pptx
dump/__MACOSX/example/._document.txt
dump/__MACOSX/example/._document.docx

Query, with no results
image

Server running

INFO:     Uvicorn running on http://0.0.0.0:8000 (Press CTRL+C to quit)
INFO:     Started reloader process [721802] using StatReload
INFO:     Started server process [721838]
INFO:     Waiting for application startup.
Attempting creation of Milvus default index
Creation of Milvus default index successful
INFO:     Application startup complete.
INFO:     127.0.0.1:56862 - "POST /query HTTP/1.1" 200 OK
INFO:     127.0.0.1:48144 - "POST /query HTTP/1.1" 200 OK
INFO:     127.0.0.1:39730 - "POST /query HTTP/1.1" 200 OK
INFO:     127.0.0.1:52404 - "POST /query HTTP/1.1" 200 OK

from chatgpt-retrieval-plugin.

nkeilar avatar nkeilar commented on May 23, 2024

@filip-halt Are you able to comment on this? How did you verify it working locally?

from chatgpt-retrieval-plugin.

nkeilar avatar nkeilar commented on May 23, 2024

@filip-halt thank you! That was indeed the issue. I can confirm after setting MILVUS_COLLECTION=somevalue for poetry server and also scripts/process_zip/process_zip.py it works as expected.

Recommendation: That we improve the documentation, as it appears to be an optional argument, which while may be true for the server, if not specified when importing data then data is imported somewhere random. Perhaps instead of a random UUID the defaults could be set to be the same for the script and server when using milvus.

I'm happy to make the change. Will just leave the comment here for a couple of days in case anyone has an opinion on best way to avoid others falling into this trap.

image

from chatgpt-retrieval-plugin.

filip-halt avatar filip-halt commented on May 23, 2024

Recommendation: That we improve the documentation, as it appears to be an optional argument, which while may be true for the server, if not specified when importing data then data is imported somewhere random. Perhaps instead of a random UUID the defaults could be set to be the same for the script and server when using milvus.

I set the name to be randomly generated as running the server twice or running two separate instances of retrieval on the same milvus server would result in shared data. I think a better route would be to have the scripts use the poetry server instead of creating their own DataStore instance. What do you think @isafulf ?

from chatgpt-retrieval-plugin.

lastrei avatar lastrei commented on May 23, 2024

oh man, i have the same trouble like you , when i post a document and query it , it's return well, when i restart the api , nothing return you notice me,

MILVUS_COLLECTION Optional Milvus collection name, defaults to a random UUID

when i restart the api , the uuid has changes
so,you must set MILVUS_COLLECTION on env

from chatgpt-retrieval-plugin.

filip-halt avatar filip-halt commented on May 23, 2024

@lastrei Ill see if I can add something into the documentation. I picked this route due to it being a lesser of two evils. If I hardcoded a value, then the information stores could clash if people share the Milvus server or if wanting to use two separate retrieval services.

from chatgpt-retrieval-plugin.

lastrei avatar lastrei commented on May 23, 2024

@lastrei Ill see if I can add something into the documentation. I picked this route due to it being a lesser of two evils. If I hardcoded a value, then the information stores could clash if people share the Milvus server or if wanting to use two separate retrieval services.

you are right ,hard code may cause these problems , but the code must save the connection name .. i write them in to a json file with connection name and Description

from chatgpt-retrieval-plugin.

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.