mirror of
https://github.com/BoardWare-Genius/jarvis-models.git
synced 2025-12-13 16:53:24 +00:00
Header changed
This commit is contained in:
@ -24,7 +24,7 @@ class Chat(Blackbox):
|
||||
return isinstance(data, list)
|
||||
|
||||
# model_name有 Qwen1.5-14B-Chat , internlm2-chat-20b
|
||||
@logging_time()
|
||||
#@logging_time()
|
||||
def processing(self, prompt: str, context: list, settings: dict) -> str:
|
||||
|
||||
if settings is None:
|
||||
@ -121,11 +121,17 @@ class Chat(Blackbox):
|
||||
url = 'https://api.openai.com/v1/completions'
|
||||
# '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'
|
||||
key = user_model_key
|
||||
|
||||
header = {
|
||||
'Content-Type': 'application/json',
|
||||
'Authorization': "Bearer " + key
|
||||
}
|
||||
# 自定义model
|
||||
else:
|
||||
url = user_model_url
|
||||
key = user_model_key
|
||||
header = {
|
||||
'Content-Type': 'application/json',
|
||||
}
|
||||
|
||||
|
||||
prompt_template = [
|
||||
@ -149,11 +155,6 @@ class Chat(Blackbox):
|
||||
"stop": str(user_stop)
|
||||
}
|
||||
|
||||
header = {
|
||||
'Content-Type': 'application/json',
|
||||
'Authorization': "Bearer " + key
|
||||
}
|
||||
|
||||
fastchat_response = requests.post(url, json=chat_inputs, headers=header)
|
||||
|
||||
return fastchat_response.json()["choices"][0]["message"]["content"]
|
||||
|
||||
Reference in New Issue
Block a user