prodigy.json setting causes web app error

Ahhhh, I’m so glad it worked :tada: Sorry again! I’ve already added the fix to prevent this sort of stuff in the next version. I also moved the posts over to this thread, which turned out to be related to the same problem.

2 Likes

Thank you so much for this thread. I was going crazy this morning after updating to 1.5.1. But the trick with the css value solved the issue. But serious: In my case there was no error message at all. Just this meaningless Oops-Error in the Frontend. Not helpful to find the error by my own!

To add an update on this thread, I ran into the same problem where the web browser GUI was not working. After investigation, I found out the GUI worked in google chrome but not internet explorer.

@adingler711 In general, Prodigy should work on IE and a variety of old browsers. But it's possible you ran into this issue. That's currently a known problem which tends to occur in (secure) cloud environments:

@ines, that makes sense. Thank you! You are correct the IE browser is within a secure cloud environment.

1 Like

Hi @ines,

I'm running into the same problem, but the css setting doesn't work for me. I'm running a custom coref recipe and it works but six texts in it encounters the following error:

and my prodigy.json file is empty except for {} - screenshot below:

I added "card_css": {} between the two brackets and it runs, but still gives the error message. I replaced everything with only "card_css": {} and then it doesn't start the server.
I'm running prodigy 1.11.4 on Windows 10 with Python 3.9.6.

Hi everyone,

I installed Prodigy successfully. When it comes to uploading my datafile for text classification, it is showing error. Below mentioned is the flow of my work:
First I uploader JSONL to jupyterlab, afterwards, I run these commands:
i) from prodigy.components.loaders import JSONL
jsonl_stream = JSONL("path/to/example.jsonl")
ii) !python -m prodigy textcat.teach example blank:en ./example.jsonl --label POSITIVE,NEGATIVE

& receive this error:

Using 2 label(s): POSITIVE, NEGATIVE
Added dataset example to database SQLite.

Failed to load task (invalid JSON on line 1)
This error pretty much always means that there's something wrong with this line
of JSON and Python can't load it. Even if you think it's correct, something must
confuse it. Try calling json.loads(line) on each line or use a JSON linter.

Someone please help me to resolve this issue?

Best Regards,

hi @Ummarafatima!

Thanks for your question and glad to see you join the Prodigy community :wave:

As the error message mentions, I suspect there may be something wrong with your .jsonl file.

Try to use this link to double check your jsonl formatting.

Alternatively, perhaps try to run once on only your first record, the first 10 or 50% of your data. The key thing you'd want to see is does it run for either of these files (which would indicate some of your records are fine, while others are in an incorrect format) or does it not work for any of the files (which indicates all of your records have issues).

Unfortunately by this error, I suspect you have an issue with your first line (record) which would likely indicate there's an issue with the entire file.

Remember you can also reformat your input source file as .csv file or .txt too if you don't want to use .jsonl.

Hope this helps!

1 Like

Hi Ryan,

Thanks a lot for the good response. I really appreciate the way Prodigy team is helping to over come various issues time to time.

I followed your instructions and was successfully uploaded my data file "climatefile" for text classification.
Mentioned below is the flow of my work:

from prodigy.components.loaders import JSONL

jsonl_stream = JSONL("path/to/climatefile.jsonl")

successfully run this code.
Afterwards, get an error with this code:

!python -m prodigy textcat.teach example blank:en ./climatefile.jsonl --label POSITIVE,NEGATIVE

Output:
Using 2 label(s): POSITIVE, NEGATIVE [*] Starting the web server at http://localhost:8080 ... Open the app in your browser and start annotating!

ERROR: [Errno 10048] error while attempting to bind on address ('::1', 8080, 0, 0): only one usage of each socket address (protocol/network address/port) is normally permitted

What I presumed is that I practiced with different different files, may be that's why multiple sessions are open. I don't know how to close the sessions. Can you please help?
One more thing:
When I run this code:

!python -m prodigy stats

Output:

============================= [*] Prodigy Stats =============================

Version 1.11.13
Location C:\Users\ummar\anaconda3\lib\site-packages\prodigy
Prodigy Home C:\Users\ummar.prodigy
Platform Windows-10-10.0.22621-SP0
Python Version 3.10.9
Database Name SQLite
Database Id sqlite
Total Datasets 4
Total Sessions 15

It is showing multiple sessions, with multiple datasets. Even I tried to close the sessions by closing all KERNELS, TERMINALS and Tabs in JupyterLab but still the problem is same. Can you please guide how to remove multiple datasets along with closing multiple sessions?

I thank you in anticipation.

for clarification:
I converted .csv to jsonl and also check whether it's valid jsonl, following your instructions. then I uploaded that to JupyterLab and give path to that file.
Previously Prodigy was working on prodigy sample commands and sessions were running.

This error has little to do with your input file, it rather seems like you're running multiple services on the same port. You could try running Prodigy on a different port by setting the PRODIGY_CONFIG_OVERRIDES environment variable like so:

PRODIGY_CONFIG_OVERRIDES='{"port": 12345}' prodigy ...

Alternatively you can also add a prodigy.json file to the folder where you're running the command with the port setting.

{
    "port": 12345
}

Both methods will have Prodigy try out port number 12345 instead.

1 Like

Thanks a lot for the response.
I have tried to change the port to 12345.

when I run this code:
!python -m PRODIGY_CONFIG_OVERRIDES='{"port": 12345}' prodigy ...

The error is:

C:\Users\ummar\anaconda3\python.exe: No module named PRODIGY_CONFIG_OVERRIDES='{port:

Kindly help me resolve this issue!...

The order matters in the command here.

The python -m part is telling Python to run a command line from a Python module such that when you run python -m prodigy that it picks Prodigy. In your case you're not providing a Python module but a environment variable. I think this should work:

PRODIGY_CONFIG_OVERRIDES='{"port": 12345}' python -m prodigy ...

Also, am I correct to say that you're running this from a Jupyter notebook instead of the terminal? If so, is there a reason for that?

Also, you may also use the prodigy.json configuration file if that's less confusing.

Extra

If you're interested in learning more about how command line utilities in Python interact with python -m, then you may enjoy this typer course on calmcode.

1 Like

Thanks a lot for the response.
when I run your recommended code, the output error is:

Cell In[9], line 1
PRODIGY_CONFIG_OVERRIDES='{"port": 12345}' python -m prodigy ...
^
SyntaxError: invalid syntax

I am new to coding and using Jupyterlab.
I added prodigy.json file to the folder in jupyterlab, where I am running the commands with the port setting 12345. it didn't work.

I thank you in anticipation for the kind support.

Ah, then I get it. If you're running from a Jupyter notebook you need the ! to indicate that you're not running a Python command but a bash command. So in your case it should be this:

! PRODIGY_CONFIG_OVERRIDES='{"port": 12345}' python -m prodigy ...
1 Like

Sorry, but I already tried with this:
! PRODIGY_CONFIG_OVERRIDES='{"port": 12345}' python -m prodigy ...

output is:

'PRODIGY_CONFIG_OVERRIDES' is not recognized as an internal or external command,
operable program or batch file.

Thanks for the response.

That's somewhat strange, it certainly does seem to work on my machine. An alternative is to run the bash command in a cell with %%bash mentioned on top.

Just to check, are you running via Jupyter lab? If so, you can also just start a terminal from there (and this might just be a whole bunch easier).

This gives you a terminal where you should also be able to run your commands from.

This way, you won't have to worry about the ! or %%bash stuff in your Jupyter cells.

1 Like

I tried with

%%bash
PRODIGY_CONFIG_OVERRIDES='{"port": 12345}' python -m prodigy

again error, I attached screen shots for reference.

following your instructions, when I run it in terminal with this:

! PRODIGY_CONFIG_OVERRIDES='{"port": 12345}' python -m prodigy

again error...available recipes didn't display in either case.

In a terminal you no longer need to use !. That's only meant for a cell in Jupyter, which is also what the error is mentioning. Could you try one more time, in the terminal, without !?

Yes, following your instructions, received this error:

PS C:\Users\ummar> PRODIGY_CONFIG_OVERRIDES='{"port": 12345}' python -m prodigy
PRODIGY_CONFIG_OVERRIDES={"port": 12345} : The term 'PRODIGY_CONFIG_OVERRIDES={"port": 12345}' is not recognized as the name of a cmdlet, function, script file, or operable program.
Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
At line:1 char:1

  • PRODIGY_CONFIG_OVERRIDES='{"port": 12345}' python -m prodigy
  •   + CategoryInfo          : ObjectNotFound: (PRODIGY_CONFIG_OVERRIDES={"port": 12345}:String) [], CommandNotFoundException
      + FullyQualifiedErrorId : CommandNotFoundException
    

Thanks a lot for putting so much effort to resolve this issue.