Closed yayaQAQ closed 8 months ago
my code, I am testing the stability of the service and determining whether it will be blocked and so on.
def gpt3():
count = 1
session_token = "my token here"
while 1:
try:
with SyncChatGPT(session_token=session_token) as chatgpt:
prompt = "请帮我生成一篇关于'雅鲁藏布江见闻'的文章,使用Markdown进行排版。至少要1000字。"
conversation = chatgpt.create_new_conversation()
for message in conversation.chat(prompt):
print(message["content"], flush=True, end="")
print(f"\n-----------------------第{count}次-------------------\n")
time.sleep(3+3*random.random())
count += 1
except Exception as e:
print(e)
print(f"\n-----------------------第{count}次-------------------\n")
time.sleep(3+3*random.random())
my code, I am testing the stability of the service and determining whether it will be blocked and so on.
def gpt3(): count = 1 session_token = "my token here" while 1: try: with SyncChatGPT(session_token=session_token) as chatgpt: prompt = "请帮我生成一篇关于'雅鲁藏布江见闻'的文章,使用Markdown进行排版。至少要1000字。" conversation = chatgpt.create_new_conversation() for message in conversation.chat(prompt): print(message["content"], flush=True, end="") print(f"\n-----------------------第{count}次-------------------\n") time.sleep(3+3*random.random()) count += 1 except Exception as e: print(e) print(f"\n-----------------------第{count}次-------------------\n") time.sleep(3+3*random.random())
Why are you initializing SyncChatGPT again and again? Only initialize it once. Every time SyncChatGPT/AsyncChatGPT is initialized, it retrieves an auth token from chatgpt with the session token you provide. initializing them multiple times when you can just initialize them once is inefficient and may cause unexpected errors. And I've never encountered this issue before.
my code, I am testing the stability of the service and determining whether it will be blocked and so on.
def gpt3(): count = 1 session_token = "my token here" while 1: try: with SyncChatGPT(session_token=session_token) as chatgpt: prompt = "请帮我生成一篇关于'雅鲁藏布江见闻'的文章,使用Markdown进行排版。至少要1000字。" conversation = chatgpt.create_new_conversation() for message in conversation.chat(prompt): print(message["content"], flush=True, end="") print(f"\n-----------------------第{count}次-------------------\n") time.sleep(3+3*random.random()) count += 1 except Exception as e: print(e) print(f"\n-----------------------第{count}次-------------------\n") time.sleep(3+3*random.random())
Why are you initializing SyncChatGPT again and again? Only initialize it once. Every time SyncChatGPT/AsyncChatGPT is initialized, it retrieves an auth token from chatgpt with the session token you provide. initializing them multiple times when you can just initialize them once is inefficient and may cause unexpected errors. And I've never encountered this issue before.
ok, I will try it.
Change to only one authentication, and do not go to the agent, there is no problem. But there's another problem, it seems that gpt3 also has a number limit, right? Only 52 requests in an hour? But I also use the same account on the web page is normal use
Only 52 requests in an hour? But I also use the same account on the web page is normal use
If you can still use chatgpt on the web just fine after hitting the limit, it's quite an issue. I'll have to test this myself and see what is causing this.
Only 52 requests in an hour? But I also use the same account on the web page is normal use
If you can still use chatgpt on the web just fine after hitting the limit, it's quite an issue. I'll have to test this myself and see what is causing this.
ok👌, this is my code. hope it helps.
from re_gpt import SyncChatGPT
import time
import random
import requests
import json
import argparse
def gpt3():
session_token = "token here"
success_count = 0
error_count = 0
for item in range(100):
try:
with SyncChatGPT(session_token=session_token) as chatgpt:
while 1:
prompt = "请帮我生成一篇关于'雅鲁藏布江见闻'的文章,使用Markdown进行排版。至少要1000字。"
conversation = chatgpt.create_new_conversation()
for message in conversation.chat(prompt):
print(message["content"], flush=True, end="")
print(f"\n-----------------------成功{success_count}失败{error_count}-------------------\n")
time.sleep(5+3*random.random())
success_count += 1
except Exception as e:
print(e)
print(f"\n-----------------------成功{success_count}失败{error_count}-------------------\n")
error_count += 1
time.sleep(3+3*random.random())
gpt3 正常的很。
gpt3 runs for a period of time will report errors, and stuck, how to improve this? Replacing the session token will work for a while, but it will still be a problem after a while. Could it be a matter of proxy?