Open babytdream opened 1 year ago
me too, but I did't find the solution. If you have any advancements, be free to contact me, Thanks.
me toooooooooo
This problem is due to openai, you need to add payment detail and add at least $5 into the account then problem solved. The free $5 credit is not usable if you never reload credit.
不是 这个运行报错了 这个像是走提示模板时发生错误 然后报错体现列表超出范围 我需要看更多的报错信息
I had the same problem:
I'm not using OpenAI api, but instead GPT4All 'orca-mini-3b-gguf2-q4_0.gguf', mac M1... running "run 10" have been fine (I ran it 3 times), but "run 5" and "run 1" both had "index out of bound problems" Anyone had the same issue?
Liu-Yonghu
It's not working for me even after doing this. Could there be some other issue?
I figured this one out. It's just a string parsing issue. The duration variable in line 378 gets messed up because the code earlier in the function is expecting the gpt_response to contain the string "duration in minutes:" but when the error happens the prompt has a string that reads "duration:" only. So the code fails after that because "in minutes" is not there. I just wrote a quick fix to get it working. Checked that "duration in minutes:" was there and if not I parsed it with just "duration:"
if "duration in minutes" in i:
k = [j.strip() for j in i.split("(duration in minutes:")]
else:
k = [j.strip() for j in i.split("(duration:")]
I figured this one out. It's just a string parsing issue. The duration variable in line 378 gets messed up because the code earlier in the function is expecting the gpt_response to contain the string "duration in minutes:" but when the error happens the prompt has a string that reads "duration:" only. So the code fails after that because "in minutes" is not there. I just wrote a quick fix to get it working. Checked that "duration in minutes:" was there and if not I parsed it with just "duration:"
if "duration in minutes" in i: k = [j.strip() for j in i.split("(duration in minutes:")] else: k = [j.strip() for j in i.split("(duration:")]
There was yet another case where the gpt_response had an entry that did not have a "duration" AT ALL. It just contained the task. So I modified the code a bit more. My fix is SUPER ugly. Hopefully someone will write a cleaner code block than me but here's what I did. Not tested yet:
if "duration in minutes" in i:
k = [j.strip() for j in i.split("(duration in minutes:")]
elif "duration" in i:
k = [j.strip() for j in i.split("(duration:")]
else:
task = i
duration = 0 #arbitrary value, don't know if 0 minutes will hurt anything
if "duration" in i:
task = k[0]
if task[-1] == ".":
task = task[:-1]
duration = int(k[1].split(",")[0].strip())
cr += [[task, duration]]
我想通了这个。这只是一个字符串解析问题。第 378 行中的 duration 变量搞砸了,因为函数前面的代码期望gpt_response包含字符串 “duration in minutes:”,但是当错误发生时,提示符有一个字符串,仅显示 “duration:”。因此,代码在那之后会失败,因为“几分钟内”不存在。我刚刚写了一个快速修复程序来让它正常工作。检查了“以分钟为单位的持续时间:”是否存在,如果没有,我只使用“持续时间:”进行解析。
if "duration in minutes" in i: k = [j.strip() for j in i.split("(duration in minutes:")] else: k = [j.strip() for j in i.split("(duration:")]
还有另一种情况,gpt_response有一个条目根本没有“持续时间”。它只是包含了任务。所以我对代码进行了更多的修改。我的修复是超级丑陋的。希望有人会写出比我更干净的代码块,但这就是我所做的。尚未测试:
if "duration in minutes" in i: k = [j.strip() for j in i.split("(duration in minutes:")] elif "duration" in i: k = [j.strip() for j in i.split("(duration:")] else: task = i duration = 0 #arbitrary value, don't know if 0 minutes will hurt anything if "duration" in i: task = k[0] if task[-1] == ".": task = task[:-1] duration = int(k[1].split(",")[0].strip()) cr += [[task, duration]]
这是一种解决方法
like #92 I use my own api_base. Whenever
run xxx
ends, this error will appear. Has anyone encountered this problem?