katanaml / sparrow

Data processing with ML and LLM
https://katanaml.io
GNU General Public License v3.0
3.57k stars 371 forks source link

extraction Invalid sparrow key error #9

Closed dani-lu closed 1 year ago

dani-lu commented 1 year ago

I already installed the application through the docker method and the normal streamlit run method and I don't know what I'm doing wrong but when I try to execute the extraction for a given document it gives me this error:

{ "error":"Invalid Sparrow key." }

Also I can't delete or create any labels or groups in the setup section.

Thanks for all your work.

abaranovskis-redsamurai commented 1 year ago

Hi. If you run it on your on infra, you can set your own value to sparrow_key. Simply set your own value in config.py from sparrow-ui and set the same value in config.py from sparrow-ml.

I tested, create/delete groups/labels from UI works fine. Are you getting any error in the log? As a workaround you can always add data in JSON directly, check labels.json and groups.json in docs folder.

abaranovskis-redsamurai commented 1 year ago

It looks like problem with Aggrid library. I updated requirements.txt to include the version I'm using:

streamlit-aggrid==0.3.3

Try with this version.

dani-lu commented 1 year ago

First of all, thanks for your quick response, I really appreciate it.

Setting the sparrow_key like you told seems to fix the create and deleting labels, but it stills giving me the same "Invalid Sparrow key." error when I try to extract information from any document from the inference tab, is this sparrow key some api_key you have to provide in order to be a valid one, and if so, where I can get it?

thank you very much.

abaranovskis-redsamurai commented 1 year ago

Ok, I got it. You get this error, because API URL points to our Hugging Face Spaces instance. You should change API URL to point to your own Sparrow ML service (where you set your own key). In Sparrow UI, go to views/data_inference.py, go to function render_results and change API URL there.

Hope it works now.

dani-lu commented 1 year ago

Yes!, it's all working now, thank you very much!

Harshitdy commented 1 year ago

Hey @abaranovskis-redsamurai! I'm very new to it and getting same error can you elaborate how to solve it.

abaranovskis-redsamurai commented 1 year ago

Hey @abaranovskis-redsamurai! I'm very new to it and getting same error can you elaborate how to solve it.

Sparrow Key is used to control access to the API. But if you run the code locally you can set your own Sparrow Key as you wish. Just replace it with your own value as described above. If you run Sparrow UI and want to test inference, make sure to change API URL to point to your local instance (see description above)

ankSaltoris commented 7 months ago

Ok, I got it. You get this error, because API URL points to our Hugging Face Spaces instance. You should change API URL to point to your own Sparrow ML service (where you set your own key). In Sparrow UI, go to views/data_inference.py, go to function render_results and change API URL there.

Hope it works now.

I have a question , in views/data_inference.py - add the path of ml config.py or anything else ?