Back

local variable 'path' referenced before assignment

  • 0
  • Databases
  • Web
bladmist
30 Aug, 2023, 15:46

I'm working with openai to process a document, trying to send the response to my db. I don't have 'path' declared anywhere else in my code. What could possibly be causing this? Would appreciate any advice.

This was working perfectly last night when I was working with hugginface/llama instead.

TL;DR
The user is experiencing an error message related to a local variable 'path' referenced before assignment in their Python code. They are unsure what might be causing the issue, as they have not declared the variable elsewhere in their code. The error occurred while working with OpenAI and trying to send a response to a database. They are seeking advice on what could be causing the error. The user also mentions that the code was working fine when using hugginface/llama instead of OpenAI. Solution: It seems like the variable 'path' is not being declared before it is being referenced in the code. To fix this, the user
Binyamin
30 Aug, 2023, 15:48

Where you've declared the path variable before that?

bladmist
30 Aug, 2023, 15:51

Haven't declared it anywhere else. These are my imports also, cannot see anything that may be creating the variable underneath.

bladmist
30 Aug, 2023, 15:52
Binyamin
30 Aug, 2023, 15:53

It's a bit more general Python issue But you can't use the replace method on variable you havn't declare before What it would replace?

bladmist
30 Aug, 2023, 15:58

Yeah, I get that. I'm just confused what might be causing this. I have to wait for my colab gpu to refresh so I can test this again with llama, cause it worked fine yesterday.

Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more