Closed mads-oestergaard closed 1 year ago
Is this issue solved? I repeated the operation, it always show as below?
12:23PM DBG Request received: {"model":"gpt-3.5-turbo","file":"","language":"","response_format":"","size":"","prompt":null,"instruction":"","input":null,"stop":null,"messages":[{"role":"user","content":"how do i sort a list in python?"}],"stream":false,"echo":false,"top_p":0,"top_k":0,"temperature":0,"max_tokens":0,"n":0,"batch":0,"f16":false,"ignore_eos":false,"repeat_penalty":0,"n_keep":0,"mirostat_eta":0,"mirostat_tau":0,"mirostat":0,"frequency_penalty":0,"tfz":0,"seed":0,"mode":0,"step":0,"typical_p":0}
12:23PM DBG Parameter Config: &{OpenAIRequest:{Model:starchat-beta.ggmlv3.q4_0.bin File: Language: ResponseFormat: Size: Prompt:
Yes, I see the same thing. If you modify the template to "<|system|>\n<|end|>\n<|user|>{{.Input}} <|end|>\n<|assistant|>" similar to the example in https://huggingface.co/HuggingFaceH4/starchat-beta, see the code block, then there is still no output:
api_1 | 7:57AM DBG Parameter Config: &{OpenAIRequest:{Model:starchat-beta-q4_1.ggmlv3 File: Language: ResponseFormat: Size: Prompt:<nil> Instruction: Input:<nil> Stop:<nil> Messages:[] Stream:false Echo:false TopP:0 TopK:0 Temperature:0 Maxtokens:0 N:0 Batch:0 F16:false IgnoreEOS:false RepeatPenalty:0 Keep:0 MirostatETA:0 MirostatTAU:0 Mirostat:0 FrequencyPenalty:0 TFZ:0 Seed:0 Mode:0 Step:0 TypicalP:0} Name:starchat StopWords:[] Cutstrings:[] TrimSpace:[] ContextSize:8192 F16:false Threads:4 Debug:true Roles:map[] Embeddings:false Backend:starcoder TemplateConfig:{Completion: Chat:chat Edit:} MirostatETA:0 MirostatTAU:0 Mirostat:0 NGPULayers:0 MMap:false MMlock:false LowVRAM:false TensorSplit: MainGPU: ImageGenerationAssets: PromptCachePath: PromptCacheAll:false PromptCacheRO:false PromptStrings:[] InputStrings:[] InputToken:[]}
api_1 | 7:57AM DBG Template found, input modified to: <|system|>
api_1 | <|end|>
api_1 | <|user|> how do i sort a list in python? <|end|>
api_1 | <|assistant|>
api_1 | 7:57AM DBG Loading model starcoder from starchat-beta-q4_1.ggmlv3
api_1 | 7:57AM DBG Loading model in memory from file: /models/starchat-beta-q4_1.ggmlv3
api_1 | 7:57AM DBG Response: {"object":"chat.completion","model":"starchat","choices":[{"message":{"role":"assistant"}}],"usage":{"prompt_tokens":0,"completion_tokens":0,"total_tokens":0}}
api_1 | [10.4.80.103]:47196 200 - POST /v1/chat/completions
I suspect it has something to do with the stop-token.
Yes, I see the same thing. If you modify the template to "<|system|>\n<|end|>\n<|user|>{{.Input}} <|end|>\n<|assistant|>" similar to the example in https://huggingface.co/HuggingFaceH4/starchat-beta, see the code block, then there is still no output:
api_1 | 7:57AM DBG Parameter Config: &{OpenAIRequest:{Model:starchat-beta-q4_1.ggmlv3 File: Language: ResponseFormat: Size: Prompt:<nil> Instruction: Input:<nil> Stop:<nil> Messages:[] Stream:false Echo:false TopP:0 TopK:0 Temperature:0 Maxtokens:0 N:0 Batch:0 F16:false IgnoreEOS:false RepeatPenalty:0 Keep:0 MirostatETA:0 MirostatTAU:0 Mirostat:0 FrequencyPenalty:0 TFZ:0 Seed:0 Mode:0 Step:0 TypicalP:0} Name:starchat StopWords:[] Cutstrings:[] TrimSpace:[] ContextSize:8192 F16:false Threads:4 Debug:true Roles:map[] Embeddings:false Backend:starcoder TemplateConfig:{Completion: Chat:chat Edit:} MirostatETA:0 MirostatTAU:0 Mirostat:0 NGPULayers:0 MMap:false MMlock:false LowVRAM:false TensorSplit: MainGPU: ImageGenerationAssets: PromptCachePath: PromptCacheAll:false PromptCacheRO:false PromptStrings:[] InputStrings:[] InputToken:[]} api_1 | 7:57AM DBG Template found, input modified to: <|system|> api_1 | <|end|> api_1 | <|user|> how do i sort a list in python? <|end|> api_1 | <|assistant|> api_1 | 7:57AM DBG Loading model starcoder from starchat-beta-q4_1.ggmlv3 api_1 | 7:57AM DBG Loading model in memory from file: /models/starchat-beta-q4_1.ggmlv3 api_1 | 7:57AM DBG Response: {"object":"chat.completion","model":"starchat","choices":[{"message":{"role":"assistant"}}],"usage":{"prompt_tokens":0,"completion_tokens":0,"total_tokens":0}} api_1 | [10.4.80.103]:47196 200 - POST /v1/chat/completions
I suspect it has something to do with the stop-token.
I was succeeded with the following prompt tmpl:
{{.Input}} <|end|>
<|assistant|>
Hi! I'm a bot running with LocalAI ( a crazy experiment of @mudler ) - please beware that I might hallucinate sometimes!
_but.... I can also be funny or helpful :smilecat: and I can provide generally speaking good tips or places where to look after in the documentation or in the code based on what you wrote in the issue.
Don't engage in conversation with me, I don't support (yet) replying!
Based on the information provided, it seems like there is a problem with the GPT-3 model not being able to sort a list in Python. Here are some possible solutions or debugging steps that can be taken:
Sources:
It looks like the issue can be fixed by using the prompt template as @luoweb mentioned above. I am going to close this issue now. Please free to open it if the issue still occurs.
LocalAI version:
Running container image
quay.io/go-skynet/local-ai:latest
with the docker-compose.yaml from master (commit 295f3030a9f76f7f36705abb760a2cd351d2b4d8)Environment, CPU architecture, OS, and Version:
Linux hostname 5.13.0-41-generic #46~20.04.1-Ubuntu SMP Wed Apr 20 13:16:21 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux
Describe the bug
With StarChat Beta, a instruct finetuned starcoder, I cannot get responses through the API.
The output of does not appear to be parsed correctly; there is no content in the reply:
To Reproduce
Download one of the ggml starchat beta models:
$ wget https://huggingface.co/TheBloke/starchat-beta-GGML/resolve/main/starchat-beta.ggmlv3.q4_1.bin -O models/starchat-beta-q4_1.ggmlv3
$ touch models/gpt-3.5-turbo.yaml
Insert this config in gpt-3.5-turbo.yamlCreate a chat.tmpl file and add this to it:
Call the
Expected behavior
I would expect the response to contain something like this, generated from the demo on https://huggingface.co/HuggingFaceH4/starchat-beta: There are multiple ways to sort a list in Python. One of the most common ways is to use the sort() method. Here is an example:
This will sort the list in place and print the sorted list.
Logs
Additional context