我不断收到如下错误
Request timed out: HTTPSConnectionPool(host='api.openai.com', port=443): Read timed out. (read timeout=600)
当我运行下面的代码时
def generate_gpt3_response(user_text, print_output=False):
"""
Query OpenAI GPT-3 for the specific key and get back a response
:type user_text: str the user's text to query for
:type print_output: boolean whether or not to print the raw output JSON
"""
time.sleep(5)
completions = ai.Completion.create(
engine='text-davinci-003', # Determines the quality, speed, and cost.
temperature=0.5, # Level of creativity in the response
prompt=user_text, # What the user typed in
max_tokens=150, # Maximum …Run Code Online (Sandbox Code Playgroud) 我想根据一些规则删除数据中的“+”。
假设我的数据如下所示
++
+coke
coke+burger+
+
coke+burger+fries
coke+burger+fries+
Run Code Online (Sandbox Code Playgroud)
在这里,我希望最终处理的数据如下所示,以便所有不在字符串之间的“+”都被删除。
coke
coke+burger
coke+burger+fries
coke+burger+fries
Run Code Online (Sandbox Code Playgroud)
谢谢。
我尝试删除特殊字符,但它删除了所有“+”。