3 ms·
I always test with a query about Django "not equal" filtering and it always hallucinates, same thing here (the "ne" lookup doesn't exist and has never existed):
by weird-eye-issue 4y ago
I always test with a query about Django "not equal" filtering and it always hallucinates, same thing here (the "ne" lookup doesn't exist and has never existed):
To do a “not equal” comparison in a Django queryset filter, you can use the __ne lookup type. For example, if we have a model called MyModel with a field called field, we could filter out all instances where the field field is not equal to ‘value’ with the following code
- rushingcreek 4y agoDid you try Expert mode?
- weird-eye-issue 4y agoSame problem For some reason this seems to be trained deep into the GPT model. Even when you tell it in the prompt it doesn't exist sometimes it will contradict itself. That's why it can be an interesting test case
- weird-eye-issue 4y agoBtw it does some weird escaping for JavaScript string literals, also the regex was wrong: const htmlString = '<img src="image1.jpg" alt="Image 1"><img src="image2.jpg">'; const regex = /<img\s[^>]*?src\s*=\s*['"]([^'"]+?)['"][^>]*?(?:alt\s*=\s*['"]([^'"]*?)['"])?[^>]*?>/gi; let match; while ((match = regex.exec(htmlString)) !== null) { const src = match[1]; const alt = match[2] || null; console.log(`src: \${src}, alt: \${alt}`); }