You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Setting chat_template using tuple raise reference before assignment on Ollama #637
Hey, I am using custom chat template for all of my projects. Therefore I usually pass tuple to chat_template params on get_chat_template.
With latest commit, there's a conflict on this. In the get_chat_template, if you pass tuple, then it'll unpack 2 values from it (code that I was talking about). But it makes this ollama chat template error because we didn't define it in above. I can't pass 4 values into this because it'll raise an error for unpacking to much values.
I think the solution for now could be defining default value like this for now?
iftype(chat_template) in (list, tuple,):
# list default value for unpackingdefault_values= ["", "", False, None]
chat_template, stop_word, yes_map_eos_token, ollama_modelfile= (chat_template+default_values[len(chat_template):])[:4]
chat_template, stop_word=chat_templateassert(type(chat_template) isstr)
assert(type(stop_word) isstr)
I think my explanation is horrible (sorry bad english), feel free to ask it more btw if you still confused.
Activity
NeedsLoomis commentedon Jun 15, 2024
Same issue
Results in
danielhanchen commentedon Jun 15, 2024
Oh my whoops! Will fix this asap! Thanks for the heads up!
danielhanchen commentedon Jun 15, 2024
Just fixed this! (Hopefully!)
Erland366 commentedon Jun 22, 2024
Wait, forgot to respond this. Been tried this for a week ago and it runs fine. Tysm btw as always! will close this :D
security: persist-credentials:false on every actions/checkout (org-wi…
tests: import_fixes drift detectors (HARD GATE on Core matrix) (unslo…
tests: import_fixes drift detectors (HARD GATE on Core matrix) (unslo…