My VS Code Python breakpoints don't seem to be hit when I trigger an event from a Gradio application that I launched via the VS Code debugger. Have you any idea how I can get them to be hit?
Assistant
There are a few things you can try to get your breakpoints to hit when debugging a Gradio application in VS Code:
Make sure that you have the latest version of Python, VS Code, and the Python extension for VS Code installed.
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.
Make sure that you are using the "Python: Current File" configuration in your launch.json file. This is the default configuration that is created when you first set up debugging in VS Code.
Make sure that you are launching the Gradio application from within VS Code by using the "Run > Start Debugging" command or by pressing F5. This will ensure that the debugger is attached to the process.
Make sure that you are setting breakpoints in the correct file. The breakpoints will only be hit if they are set in the file that is currently being executed.
If you are using multiprocessing or multithreading in your application, you may need to use the "Python: Module" configuration in your launch.json file and specify the name of the module that you want to debug. This will allow the debugger to attach to all of the processes or threads in your application.
If none of the above solutions work, you can try adding the following line of code to your application before the breakpoint:
This will start the pydevd debugger and attach it to the current process. You can then set breakpoints in VS Code and they should be hit when the application is running.
I hope this helps! Let me know if you have any other questions.