RD-Agent icon indicating copy to clipboard operation
RD-Agent copied to clipboard

JSONDecodeError during Code Execution (before executing agent-written code)

Open tezansahu opened this issue 1 year ago • 1 comments

🐛 Bug Description

Facing the following error for every code execution stage when the general_model is used to implement a paper:

--------------Execution feedback:---------------
Execution error: Extra data: line 2 column 1 (char 77)
Traceback: Traceback (most recent call last):
  File "/mnt/d/TechStuff/RD-Agent/rdagent/components/coder/model_coder/model.py", line 97, in execute
    qtde.prepare()
  File "/mnt/d/TechStuff/RD-Agent/rdagent/utils/env.py", line 374, in prepare
    super().prepare()
  File "/mnt/d/TechStuff/RD-Agent/rdagent/utils/env.py", line 211, in prepare
    status_dict = json.loads(part)
  File "/home/tezansahu/anaconda3/envs/rdagent/lib/python3.10/json/__init__.py", line 346, in loads
    return _default_decoder.decode(s)
  File "/home/tezansahu/anaconda3/envs/rdagent/lib/python3.10/json/decoder.py", line 340, in decode
    raise JSONDecodeError("Extra data", s, end)
json.decoder.JSONDecodeError: Extra data: line 2 column 1 (char 77)

All other model responses like writing the description/formulation, as well as the response of critics on the code are returned correctly.

Command used to run: rdagent general_model --report_file_path=rdagent/scenarios/general_model/1412.6550v4_FitNet.pdf

To Reproduce

Steps to reproduce the behavior:

  1. Installed rdagent using instructions for devs: https://rdagent.readthedocs.io/en/stable/development.html
  2. Created .env file with the following settings:
    USE_AZURE=True
    USE_AZURE_TOKEN_PROVIDER=False
    MAX_RETRY=10
    RETRY_WAIT_SECONDS=20
    
    OPENAI_API_KEY=<removed>
    CHAT_MODEL=gpt-4o
    CHAT_MAX_TOKENS=3000
    CHAT_TEMPERATURE=0.7
    CHAT_AZURE_API_BASE=<removed>
    CHAT_AZURE_API_VERSION=2024-06-01
    
    EMBEDDING_MODEL=text-embedding-ada-002
    EMBEDDING_AZURE_API_BASE=<removed>
    EMBEDDING_AZURE_API_VERSION=2024-06-01
    
  3. Downloaded the FitNet paper & placed it in rdagent/scenarios/general_model/ folder
  4. Ran the command rdagent general_model --report_file_path=rdagent/scenarios/general_model/1412.6550v4_FitNet.pdf

Expected Behavior

Code execution to happen successfully & actual code errors to be found (not setup errors)

Screenshot

Image

Environment

Note: Users can run rdagent collect_info to get system information and paste it directly here.

  • Name of current operating system: Windows (using WSL 2 - Ubuntu 22.04LTS)
  • Processor architecture: AMD64
  • System, version, and hardware information: Microsoft Windows 11 Home Single Language (OS Version: 10.0.22631 N/A Build 22631) | Intel64 Family 6 Model 154 Stepping 3 GenuineIntel ~2700 Mhz processor
  • Version number of the system: 10.0.22631 N/A Build 22631
  • Python version: 3.10.15
  • Container ID:
  • Container Name:
  • Container Status:
  • Image ID used by the container:
  • Image tag used by the container:
  • Container port mapping:
  • Container Label:
  • Startup Commands: rdagent general_model --report_file_path=rdagent/scenarios/general_model/1412.6550v4_FitNet.pdf
  • RD-Agent version: 0.2.1
  • Package version:

tezansahu avatar Oct 09 '24 17:10 tezansahu

The issue you mentioned has been fixed in PR 386, please pull the latest code and run it and the issue will be resolved.

SunsetWolf avatar Oct 10 '24 08:10 SunsetWolf