Spaces:
Sleeping
Sleeping
Tuchuanhuhuhu
commited on
Commit
·
c5231fe
1
Parent(s):
56baa88
修复输入API-Key提示错误的问题
Browse files- modules/base_model.py +1 -1
- modules/models.py +0 -7
modules/base_model.py
CHANGED
@@ -464,7 +464,7 @@ class BaseLLMModel:
|
|
464 |
|
465 |
def set_key(self, new_access_key):
|
466 |
self.api_key = new_access_key.strip()
|
467 |
-
msg =
|
468 |
logging.info(msg)
|
469 |
return new_access_key, msg
|
470 |
|
|
|
464 |
|
465 |
def set_key(self, new_access_key):
|
466 |
self.api_key = new_access_key.strip()
|
467 |
+
msg = i18n("API密钥更改为了") + hide_middle_chars(self.api_key)
|
468 |
logging.info(msg)
|
469 |
return new_access_key, msg
|
470 |
|
modules/models.py
CHANGED
@@ -102,13 +102,6 @@ class OpenAIClient(BaseLLMModel):
|
|
102 |
def set_token_upper_limit(self, new_upper_limit):
|
103 |
pass
|
104 |
|
105 |
-
def set_key(self, new_access_key):
|
106 |
-
self.api_key = new_access_key.strip()
|
107 |
-
self._refresh_header()
|
108 |
-
msg = i18n("API密钥更改为了") + f"{hide_middle_chars(self.api_key)}"
|
109 |
-
logging.info(msg)
|
110 |
-
return msg
|
111 |
-
|
112 |
@shared.state.switching_api_key # 在不开启多账号模式的时候,这个装饰器不会起作用
|
113 |
def _get_response(self, stream=False):
|
114 |
openai_api_key = self.api_key
|
|
|
102 |
def set_token_upper_limit(self, new_upper_limit):
|
103 |
pass
|
104 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
105 |
@shared.state.switching_api_key # 在不开启多账号模式的时候,这个装饰器不会起作用
|
106 |
def _get_response(self, stream=False):
|
107 |
openai_api_key = self.api_key
|