Browse Source

fix: api base bug

master
zhayujie 10 months ago
parent
commit
eae95dfef5
1 changed files with 0 additions and 2 deletions
  1. +0
    -2
      bot/openai/open_ai_image.py

+ 0
- 2
bot/openai/open_ai_image.py View File

@@ -12,7 +12,6 @@ from config import conf
class OpenAIImage(object): class OpenAIImage(object):
def __init__(self): def __init__(self):
openai.api_key = conf().get("open_ai_api_key") openai.api_key = conf().get("open_ai_api_key")
openai.api_base = conf().get("open_ai_api_base")
if conf().get("rate_limit_dalle"): if conf().get("rate_limit_dalle"):
self.tb4dalle = TokenBucket(conf().get("rate_limit_dalle", 50)) self.tb4dalle = TokenBucket(conf().get("rate_limit_dalle", 50))


@@ -23,7 +22,6 @@ class OpenAIImage(object):
logger.info("[OPEN_AI] image_query={}".format(query)) logger.info("[OPEN_AI] image_query={}".format(query))
response = openai.Image.create( response = openai.Image.create(
api_key=api_key, api_key=api_key,
api_base=api_base,
prompt=query, # 图片描述 prompt=query, # 图片描述
n=1, # 每次生成图片的数量 n=1, # 每次生成图片的数量
model=conf().get("text_to_image") or "dall-e-2", model=conf().get("text_to_image") or "dall-e-2",


Loading…
Cancel
Save