s7
y[3,5,4,6,8,2,1]
y[8,5,4,6,7,2,1]
xy
# 把去掉最大值的y,拆分成2个list
maxymax(y)
maxyindexy.index(maxy)
chihuo[maxy]
ly y[0:maxyindex]
ry y[maxyindex 1:]
print(ly,ry)
if ly :while ly:if not ry or not ly:breakif ly[-1] > ry[-1]:chihuo.append(ly[-1]…
题意:“OpenAI API:如何在 API 请求之前计算令牌数量” 问题背景:
I would like to count the tokens of my OpenAI API request in R before sending it (version gpt-3.5-turbo). Since the OpenAI API has rate limits, this seems impor…