-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
use indentation from response rather than rstudioapi? #9
Comments
I'm assuming this is related to some weirdness I get when calling pal using a locally served model. I use ollama and Qwen2.5-coder:14b. Here's my .Rprofile:
I've created a toy assistant using prompt_new and the following system prompt:
(The prompt might or might not give some hints about what my problem is) When I serve Qwen with ollama from the command line using the above-mentioned system prompt and the comment
However when I trigger the pal within Rstudio, the output is mangled and sometimes contains markdown formatting, like so: Anyways, thanks for developing the package! Despite the rough edges, I'm already having a ton of fun with it. |
Thanks for the kind comment @Koalha! Stoked to hear it's functional enough that you're able to have fun with it. This is interesting. I had assumed that the kind of missing-newline behavior you were seeing was an artifact of qwen2.5-coder:14b just not being very effective when I observed something similar last week, but now that I've run that model from the command line I do see that it tends to get line-breaks right more often from that interface. I would note that, with pal's interface, I see newlines sometimes, so they're not totally disappearing: pal-qwen-newline.movIt does seem like, from either interface, the model after wants to surround output in ```r, and pal won't be in the business of "fixing" that. I'll need to check whether there's some sort of newline-disappearance that's due to pal or elmer, but I also would entertain the idea that ollama is doing something smart to infer when newlines are probably warranted but missing. |
Thanks for the quick reply @simonpcouch! Seems I should have done some more testing related to the backticks. It's actually good to hear that the problem is probably related to the specific model I was using (and maybe to its interaction with ollama), since that means I can just focus on finding a model that plays better with pal. |
Hey @Koalha, you were right! The Line 153 in f3455dd
I don't remember why I initially introduced that line in the first hacky hours of the package, and removing it seems to resolve the problem. Qwen 2.5 seems to chunk up tokens in a way that triggers this bug more often than other models. From Qwen, I see newlines included in chunks like Going to go ahead and close this issue, too, as I do think we'll continue to rely on the rstudio API to reformat. |
Should look into whether models are getting indentation right already.
The text was updated successfully, but these errors were encountered: