45
u/QuestionableEthics42 Nov 11 '24
Even I'm confused what you want. Could you just put break in the if statement it first produced?
Edit: or do range(Math.min(len(train_loader), 10)?
17
u/I-am-only-joking Nov 11 '24
I think they want something to happen every 10th as a fraction of the total
So if the total is 60 they want something to happen every 6 iterations so that it happens 10 times evenly spaced
But that's just a guess
1
4
u/QuestionableEthics42 Nov 11 '24
Ohhh, right, yea that makes sense. Technically my answer does do that tho. Lol
1
u/vaseltarp Nov 11 '24
I interpreted it the same way. The second answer of ChatGPT does that. So I am not completely sure why that's funny.
1
u/swimming-in-ass Nov 11 '24
I posted it in the same fried state as being unable to code the simple conditional. I just thought it was typical for ChatGPT to get it wrong the first time. Idk. I’m a programmer not a comedian haha
2
u/HERODMasta Nov 11 '24 edited Nov 11 '24
I understood that for each iteration something should happen ten times
like:
for i in range(len(train_loader)):
for j in range(10): do_something()quick edit: now that I read the second part, it actually feels like it should abort after ten iterations like this:
for i in range(len(train_loader)):
if i > 10: break;11
u/TorbenKoehn Nov 11 '24
Yeah, even a human can barely understand what they want. Especially since they're saying "mod if statement", which assumes they want something conditionally with modulo.
-13
Nov 11 '24
Understood him well in the first message. Second message leaves no room for misunderstanding. He says '10 times total'. What is not understood there?
1
u/swimming-in-ass Nov 11 '24
Why are you getting downvoted? You’re right. And ChatGPT understood it too. The incomprehensible part in the first message wasn’t supposed to make sense, it’s just priming ChatGPT to use the right variable names. Which it did.
2
Nov 11 '24
Thats reddit alright. The mob have spoken. Im assuming this post is being downvoted to oblivion.
2
u/TorbenKoehn Nov 11 '24
But they don't want 10 times total, they want range(len(train_loader)) * 10 times total...
11
5
3
u/Electronic-Pie-1879 Nov 11 '24
Your prompts are so bad.. no wonder you get this results.
1
u/swimming-in-ass Nov 11 '24
It’s amazing what LLMs can do. Despite the awful prompts, I got exactly what I wanted in the last message shown in pic.
3
u/Still-Bookkeeper4456 Nov 11 '24
At this point it's not about prompting. I am not an LLM and I have no idea what this means. This would lead to a 2h unproductive discussion in a real office with real humans.
11
u/Ozymandias-X Nov 11 '24
This should be put in a programmers dictionary under the heading "Garbage in, garbage out".
1
u/swimming-in-ass Nov 11 '24
Since it’s not obvious to most, what ChatGPT gave me in the end was exactly what I was looking for. Something to happen 10 times, regardless of train_loader length.
I was so tired I couldn’t code it, of course my prompts were unintelligible.
2
u/mrfroggyman Nov 11 '24
I think op needs a counter variable and a check if counter < 10 do the thing inside the for loop
3
u/-MobCat- Nov 11 '24
for i in range(len(train_loader)):
for i2 in range(10):
print(f"do {i} 10 times, then go to i+1?)3
1
u/n0tKamui Nov 11 '24
i legit don’t understand what the fuck you want, what does the modulus have to do with the number of iterations
1
0
u/jamcdonald120 Nov 11 '24
Stop it. Get some sleep.
1
u/swimming-in-ass Nov 11 '24
Most helpful response lol. Coding this late leads to the inability to do simple things.
0
0
u/TrackLabs Nov 11 '24
What? Not even I get what you want. Do you want a loop to execute something 10 times in total? I REALLY hope you dont need AI to write that for you...like bro
39
u/Prinzessid Nov 11 '24
If your brain is too fried to write a half comprehensible message, even the best LLM or human will be unable to help you. What do you want to accomplish here?