bad output

#2
by eramax - opened

I have tried multiple versions of deepseek models and found it always give me incorrect response

python examples/chat.py -m ./deepseek-coder-33b-instruct-3.0bpw-h6-exl2 -mode llama

the result

-- Model: /content/model
 -- Options: ['rope_scale 1.0', 'rope_alpha 1.0']
 -- Loading model...
 -- Loading tokenizer...
 -- Prompt format: llama
 -- System prompt:

You are a helpful, respectful and honest assistant. Always answer as helpfully as possible, while being safe.  Your answers should not include any harmful, unethical, racist, sexist, toxic, dangerous, or illegal content. Please ensure that your responses are socially unbiased and positive in nature.

User: explain quick sort

]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]

The model works fine with the right prompt template; the prompt format is automatically detected in ooba text-generation-webui. You're going to have to encode the prompt template in the example chat script to get it to work. Here's the output in ooba notebook mode (you'll need to add the stop token as well). I edited the stupid system prompt below (the default one tells the model to refuse to answer for certain questions.

You are an AI programming assistant, utilizing the Deepseek Coder model, developed by Deepseek Company. You will answer all questions truthfully and honestly.
### Instruction:
explain quick sort
### Response:
Quick Sort is a Divide and Conquer algorithm. It works by selecting a 'pivot' element from the array and partitioning the other elements into two sub-arrays, according to whether they are less than or greater than the pivot. The sub-arrays are then recursively sorted. 

Here is a Python implementation of QuickSort:

```python
def quicksort(array):
    if len(array) <= 1:
        return array
    else:
        pivot = array[len(array) // 2]
        lesser = [x for x in array if x < pivot]
        equal = [x for x in array if x == pivot]
        greater = [x for x in array if x > pivot]
        return quicksort(lesser) + equal + quicksort(greater)

In this code, we first check if the length of the input list array is less than or equal to one (meaning it has reached its base case). If so, the function returns the list itself as it doesn't need any further sorting. Otherwise, the middle index value is selected as the pivot. Then three lists are created - lesser which contains values smaller than the pivot, equal containing values equal to the pivot and greater with values larger than the pivot. These lists are then concatenated together using the + operator after calling the same function on them to perform the sort again. This continues until the smallest possible lists of size 1 are reached. At that point, the lists merge back up through the call stack.
<|EOT|> ✅️
<|EOT|> 👍🏼
<|EOT|> 😄
```

Thsnk you for your answer, I didn't use ooba text-generation-webui just used the examples/chat.py attached in the repo, Can I use this script or any other scripts and apply the prompt formats ?
Regards,

You'll need to see how Turboderp defines the prompt templates. Just copy them and create a new one for deepseek-coder.

Sign up or log in to comment