[GH-ISSUE #4830] model import to Ollama #3053

Closed
opened 2026-04-12 13:29:09 -05:00 by GiteaMirror · 3 comments
Owner

Originally created by @fingerfree77 on GitHub (Jun 5, 2024).
Original GitHub issue: https://github.com/ollama/ollama/issues/4830

Is it possible to import model to Ollama from HuggingFace which is not listed in the script convert-hf-to-gguf.py?
In my case model: https://huggingface.co/ai-forever/ruGPT-3.5-13B
When I try import got error:

Traceback (most recent call last):
  File "llm/llama.cpp/convert-hf-to-gguf.py", line 2865, in <module>
    main()
  File "llm/llama.cpp/convert-hf-to-gguf.py", line 2850, in main
    model_instance.set_vocab()
  File "llm/llama.cpp/convert-hf-to-gguf.py", line 114, in set_vocab
    self._set_vocab_gpt2()
  File "llm/llama.cpp/convert-hf-to-gguf.py", line 500, in _set_vocab_gpt2
    tokens, toktypes, tokpre = self.get_vocab_base()
  File "llm/llama.cpp/convert-hf-to-gguf.py", line 379, in get_vocab_base
    tokpre = self.get_vocab_base_pre(tokenizer)
  File "llm/llama.cpp/convert-hf-to-gguf.py", line 491, in get_vocab_base_pre
    raise NotImplementedError("BPE pre-tokenizer was not recognized - update get_vocab_base_pre()")
NotImplementedError: BPE pre-tokenizer was not recognized - update get_vocab_base_pre()
Originally created by @fingerfree77 on GitHub (Jun 5, 2024). Original GitHub issue: https://github.com/ollama/ollama/issues/4830 Is it possible to import model to Ollama from HuggingFace which is not listed in the script convert-hf-to-gguf.py? In my case model: https://huggingface.co/ai-forever/ruGPT-3.5-13B When I try import got error: ``` Traceback (most recent call last): File "llm/llama.cpp/convert-hf-to-gguf.py", line 2865, in <module> main() File "llm/llama.cpp/convert-hf-to-gguf.py", line 2850, in main model_instance.set_vocab() File "llm/llama.cpp/convert-hf-to-gguf.py", line 114, in set_vocab self._set_vocab_gpt2() File "llm/llama.cpp/convert-hf-to-gguf.py", line 500, in _set_vocab_gpt2 tokens, toktypes, tokpre = self.get_vocab_base() File "llm/llama.cpp/convert-hf-to-gguf.py", line 379, in get_vocab_base tokpre = self.get_vocab_base_pre(tokenizer) File "llm/llama.cpp/convert-hf-to-gguf.py", line 491, in get_vocab_base_pre raise NotImplementedError("BPE pre-tokenizer was not recognized - update get_vocab_base_pre()") NotImplementedError: BPE pre-tokenizer was not recognized - update get_vocab_base_pre() ```
GiteaMirror added the model label 2026-04-12 13:29:09 -05:00
Author
Owner

@sealad886 commented on GitHub (Jun 11, 2024):

The short answer is no. Ollama relies on the llama.cpp backend to serve the API. Open up an enhancement request on the llama.cpp project, or (even better!) see if you can add the pre-tokenizer yourself and open up a pull request!

<!-- gh-comment-id:2159734739 --> @sealad886 commented on GitHub (Jun 11, 2024): The short answer is no. Ollama relies on the llama.cpp backend to serve the API. Open up an [enhancement request](https://github.com/ggerganov/llama.cpp/issues/new/choose) on the llama.cpp project, or (even better!) see if you can add the pre-tokenizer yourself and open up a pull request!
Author
Owner

@DewiarQR commented on GitHub (Aug 12, 2024):

I would like to know if there has already been any progress in this direction?

<!-- gh-comment-id:2283634149 --> @DewiarQR commented on GitHub (Aug 12, 2024): I would like to know if there has already been any progress in this direction?
Author
Owner

@jmorganca commented on GitHub (Sep 4, 2024):

Closing for https://github.com/ollama/ollama/issues/1285 – thanks for the issue!

<!-- gh-comment-id:2329064324 --> @jmorganca commented on GitHub (Sep 4, 2024): Closing for https://github.com/ollama/ollama/issues/1285 – thanks for the issue!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/ollama#3053