mirror of
https://github.com/deepseek-ai/DeepSeek-V2.git
synced 2026-11-05 00:47:23 +00:00
[GH-ISSUE #34] Invalid max_token values #32
Labels
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
deepseek-ai/DeepSeek-V2#32
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @audreyeternal on GitHub (May 16, 2024).
Original GitHub issue: https://github.com/deepseek-ai/DeepSeek-V2/issues/34
I followed the instruction in README about how to utilize deepseek in langchain:
However, seems like the
max_tokensis still restricted to 4k and an error will be raised when intending to integrate the model into the chain and invoke it:@luofuli commented on GitHub (May 27, 2024):
@audreyeternal The DeepSeek-V2 API currently only supports 32K context length (input + output) with a maximum of 4K tokens for the output.
PS: Although the DeepSeek-V2 model supports 128K context length, we have restricted the API to 32K to ensure efficiency in our services.
@Swephoenix commented on GitHub (Jul 30, 2024):
Like this?
import requests
import json
url = "https://api.deepseek.com/beta/chat/completions"
headers = {
'Content-Type': 'application/json',
'Accept': 'application/json',
'Authorization': 'Bearer [hidden for this chat]'
}
def get_response(messages):
payload = json.dumps({
"messages": messages,
"model": "deepseek-coder",
"frequency_penalty": 0,
"max_tokens": 8192,
"presence_penalty": 0,
"response_format": {"type": "text"},
"stop": None,
"stream": True,
"include_usage": True,
"temperature": 0.7,
"top_p": 1,
"tools": None,
"tool_choice": "none",
"logprobs": False,
"top_logprobs": None
})