s-kostyaev / ellama

Ellama is a tool for interacting with large language models from Emacs.
GNU General Public License v3.0
359 stars 25 forks source link

Default session names with / try to create directories. #55

Closed stephenwithav closed 5 months ago

stephenwithav commented 5 months ago

<s>[INST] Explain emacs. [/INST] attempts to create a directory in ellama-sessions because of the/ in [/INST].

Replacing / with underscores in ellama-session-file will prevent that.

Should I submit a PR with that slight ellama-generate-name refactor?

s-kostyaev commented 5 months ago

Sure. Have you signed FSF papers?

s-kostyaev commented 5 months ago

Why you send template into ollama? It should be filled on ollama side. Or you use another llm provider?

stephenwithav commented 5 months ago

I use Ollama. I watched this video on Prompt-Engineering for Open-Source LLMs and it mentioned using that structure, which worked well with llama2-based models.

stephenwithav commented 5 months ago

For more clarification, I like to test new prompts interactively. Using the <s>[INST][/INST] format appears to provide more consistent responses. After reading an article yesterday, I used the following prompt:

<s>[INST] I will ask you a biochemistry question. You will provide a thorough, step-by-step answer to me as if I were a high-school freshmen currently enrolled in biology. [/INST] </s> Alabama wants to execute a man using nitrogen gas. How would that kill a man? Provide a step-by-step explanation.

That provided a more concise answer than without the tags.

s-kostyaev commented 5 months ago

You can create new ollama model with this prompt template and use it with ellama. See modelfile documentation of ollama.

stephenwithav commented 5 months ago

Yes, I'm familiar with that. My thought is this change will make it easier to iterate on prompts when designing new ones.

s-kostyaev commented 5 months ago

Sure, we need this change. Case just looks strange to me

stephenwithav commented 5 months ago

Thanks. This will also prevent errors in filenames like either/or, true/false, yes/no, etc.