TabbyML / tabby

Self-hosted AI coding assistant
https://tabby.tabbyml.com/
Other
21.43k stars 964 forks source link

Support ibm-granite #2107

Open djmaze opened 5 months ago

djmaze commented 5 months ago

Granite seems to be one of the best models at code generation (as well as explaing & fixing code). Would be nice if Tabby supported it.

pervrosen commented 4 weeks ago

You need to alter you ~/.tabby/models/{your_registry}/models.json to include: Pls see https://github.com/TabbyML/registry-tabby for more info. In your model.json add this:

  {
    "name": "granite7B",
    "provider_url": "https://huggingface.co/instructlab/granite-7b-lab",
    "license_name": "apache-2.0",
    "license_url": "apache-2.0",
    "chat_template": "{% for message in messages %}{% if message['role'] == 'system' %}{{'<|system|>'+ '\n' + message['content'] + '\n'}}{% elif message['role'] == 'user' %}{{'<|user|>' + '\n' + message['content'] + '\n'}}{% elif message['role'] == 'assistant' %}{{'<|assistant|>' + '\n' + message['content'] + '<|endoftext|>' + ('' if loop.last else '\n')}}{% endif %}{% endfor %}",
    "urls": [
      "https://huggingface.co/instructlab/merlinite-7b-lab-GGUF/resolve/main/merlinite-7b-lab-Q4_K_M.gguf"
    ],
    "sha256":"9ca044d727db34750e1aeb04e3b18c3cf4a8c064a9ac96cf00448c506631d16c"
  }