Coder Social home page Coder Social logo

Comments (8)

superuben avatar superuben commented on September 23, 2024

same here, using litellm

from taskweaver.

zhangxu0307 avatar zhangxu0307 commented on September 23, 2024

The issue might be due to an incorrect response from LLM, as we verify all required fields in the generated JSON text. If any missing fields are found, an exception arises.

from taskweaver.

j-loquat avatar j-loquat commented on September 23, 2024

You must set llm.response_format parameter in json config file of taskweaver to "text".
The api on local llm cannot talk in the default json setting.

from taskweaver.

j-loquat avatar j-loquat commented on September 23, 2024

I get a similar error running local model - but not every time:
Error: Cannot process your request due to Exception: 'NoneType' object has no attribute 'content'
Traceback (most recent call last):
File "C:\PythonPlay\TaskWeaver\taskweaver\session\session.py", line 125, in send_message
post = _send_message(post.send_to, post)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\PythonPlay\TaskWeaver\taskweaver\session\session.py", line 107, in _send_message
reply_post = self.code_interpreter.reply(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\PythonPlay\TaskWeaver\taskweaver\code_interpreter\code_interpreter.py", line 70, in reply
code.content,
^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'content'

from taskweaver.

vision360deg avatar vision360deg commented on September 23, 2024

Same issue; however I keep getting consistently the same error. I'm stuck with this basically. This was the prompt: "Process the PDF file you can find in the sample_data folder, and add up all the expenses making sure all the ammounts in Euros are first converted to USD and then summed to
all the amounts that were already reported in USD"

It starts off nicely making a plan:

>>> [INIT_PLAN]
1. Locate and read the PDF file in the sample_data folder
2. Extract text from the PDF file <sequential depend on 1>
3. Identify and extract amounts in Euros and USD from the text <sequential depend on 2>
4. Convert amounts in Euros to USD <sequential depend on 3>
5. Sum all amounts in USD <sequential depend on 4>
>>> [PLAN]
1. Locate and read the PDF file in the sample_data folder
2. Extract text from the PDF file
3. Identify and extract amounts in Euros and USD from the text
4. Convert amounts in Euros to USD
5. Sum all amounts in USD
>>> [CURRENT_PLAN_STEP]
Locate and read the PDF file in the sample_data folder
>>> [SEND_TO]
CodeInterpreter
>>> [MESSAGE]
Please locate and read the PDF file in the sample_data folder.
>>> [PLANNER->CODEINTERPRETER]
Please locate and read the PDF file in the sample_data folder.

But then always fails like below, apparently over the first step to locate and read the PDF:

Error: Cannot process your request due to Exception: 'NoneType' object has no attribute 'content'
 Traceback (most recent call last):
  File "/Users/~~~~~~/Development/code/TW/TaskWeaver/taskweaver/session/session.py", line 125, in send_message
    post = _send_message(post.send_to, post)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/~~~~~~/Development/code/TW/TaskWeaver/taskweaver/session/session.py", line 107, in _send_message
    reply_post = self.code_interpreter.reply(
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/~~~~~~/Development/code/TW/TaskWeaver/taskweaver/code_interpreter/code_interpreter.py", line 70, in reply
    code.content,
    ^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'content'

UPDATE:

I even tried 1) feeding it a much smaller PDF file (about 7 pages) and 2) actually parsing the PDF file and manually converting it to a txt file with amounts in Euros or USD on each line. With quite surprise I found out that even feeding it a 28 lines of text (each amount on its line), will still lead to the very same error reported above 😵‍💫

from taskweaver.

j-loquat avatar j-loquat commented on September 23, 2024

Taskweaver does not "see" the sample_data folder - I had the same problem. Once you start a new taskweaver session, you have to find the latest session directory and go into the "cwd" directory of it (cwd stands for current working directory). If you put your file in there, you can then refer to it by name without a path and it will see it. I still have the errors above but it does find and work with my file.

from taskweaver.

vision360deg avatar vision360deg commented on September 23, 2024

Yeah thanks for the advice; I tried putting the file in the cwd folder and it seems like it's able to find the file. But yeah after all I'm still ending up with the same AttributeError: 'NoneType' object has no attribute 'content'

from taskweaver.

j-loquat avatar j-loquat commented on September 23, 2024

Yes, I find if I keep the tasks simple or give it one step at a time, I can sometimes get things to complete without the error. I wonder what triggers that problem.

from taskweaver.

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.