j0rd1smit / obsidian-copilot-auto-completion

MIT License
128 stars 12 forks source link

Option to disable COT and examples #32

Closed xl0 closed 9 months ago

xl0 commented 9 months ago

I'd love to see an option (under Advanced) to completely disable CoT and examples.

I feel that a simple masked insertion would be enough for most uses, or at least I'd like to try and see if works better or worse.

j0rd1smit commented 9 months ago

Yeah you can already totally do that by doing the following:

  1. enable advanced mode.
  2. Change the system prompt something like:
    Your job is to predict the most logical text that should be written at the location of the <mask/>.
    Your answer can be either code, a single word, or multiple sentences.
    If the <mask/> is in the middle of a partial sentence, your answer should only be the 1 or 2 words fixes the sentence and not the entire sentence.
    You are not allowed to have any overlapping text directly surrounding the <mask/>.  
    Your answer must be in the same language as the text directly surrounding the <mask/>.
    Your response must have the following format:
    ANSWER: here, you write the text that should be at the location of <mask/>
  3. Then remove all the few-shot examples by pressing the cross.

So feel free to try that out. However, I prefer to keep CoT enabled since it gives generally more consistent results. If you are doing simple paragraph completion, you won't notice it. But in other contexts, it has a huge impact on slides full of examples of different failure modes.

xl0 commented 9 months ago

Got you, thank you!

I think there is another issue I was seeing - when the GPT response ends with "$" (end of a one-line Latex formula), I see the '$' in the debug console, but it's not shown as part of the completion.

j0rd1smit commented 9 months ago

It might have something to do with the post processors. You can disable them in the settings as well. image

xl0 commented 9 months ago

I got you, thank you. It looks like it always removes the trailing $, even if it would close the latex block.

j0rd1smit commented 9 months ago

Do you have an example such that I can test it out?

xl0 commented 9 months ago

Hmm, I thought I had it, but I can't reliably reproduce it any more. :/

j0rd1smit commented 9 months ago

Maybe setting the temperature to 0 helps to make it reproducible?

If not, I think I'm going to close this issue then since your desired behavior is already possible. If you find a reproducible error, feel free to reopen it.

xl0 commented 9 months ago

Yep, let me close it.

No, I thought I saw cases when the model would reply with a closing '$' at the end of an open math expression, and the '$' was incorrectly removed. But I can't reproduce it now.