[GH-ISSUE #5600] What is "Error: unsupported content type: text/plain; charset=utf-8"? #65538

Closed
opened 2026-05-03 21:37:26 -05:00 by GiteaMirror · 8 comments
Owner

Originally created by @k2rw on GitHub (Jul 10, 2024).
Original GitHub issue: https://github.com/ollama/ollama/issues/5600

What is the issue?

After changing to ollama version 0.2.1, when I run ollama create mymodel Modelfile, I get the following error message. the same error occurs when I change my model.
If anyone knows how to solve this problem, please let me know.

$ ollama create mymodel -f Modelfile
transferring model data
Error: unsupported content type: text/plain; charset=utf-8

OS

macOS

GPU

Apple

CPU

Apple

Ollama version

0.2.1

Originally created by @k2rw on GitHub (Jul 10, 2024). Original GitHub issue: https://github.com/ollama/ollama/issues/5600 ### What is the issue? After changing to ollama version 0.2.1, when I run ollama create mymodel Modelfile, I get the following error message. the same error occurs when I change my model. If anyone knows how to solve this problem, please let me know. $ ollama create mymodel -f Modelfile transferring model data Error: unsupported content type: text/plain; charset=utf-8 ### OS macOS ### GPU Apple ### CPU Apple ### Ollama version 0.2.1
GiteaMirror added the bug label 2026-05-03 21:37:26 -05:00
Author
Owner

@amy890202 commented on GitHub (Jul 12, 2024):

I faced same error and found that I downloaded the gguf pointer file not gguf file from huggingface by mistake, so that it come to this error.
After I download the right gguf file, the problem is solved.

<!-- gh-comment-id:2224834102 --> @amy890202 commented on GitHub (Jul 12, 2024): I faced same error and found that I downloaded the gguf pointer file not gguf file from huggingface by mistake, so that it come to this error. After I download the right gguf file, the problem is solved.
Author
Owner

@joshyan1 commented on GitHub (Jul 12, 2024):

Hey @k2rw, is it possible for you to provide a link to the file that you are using as well as your Modelfile so we can try and reproduce the issue? Thanks.

<!-- gh-comment-id:2224886427 --> @joshyan1 commented on GitHub (Jul 12, 2024): Hey @k2rw, is it possible for you to provide a link to the file that you are using as well as your Modelfile so we can try and reproduce the issue? Thanks.
Author
Owner

@dcasota commented on GitHub (Aug 3, 2024):

Hi @joshyan1,

Here a recipe extract to reproduce the issue.

cd $HOME
export RELEASE=0.3.3
echo Installing Ollama Release $RELEASE ...
curl -fsSL https://ollama.com/install.sh | sed "s#https://ollama.com/download#https://github.com/ollama/ollama/releases/download/v\$RELEASE#" | sh
# Get the Ollama source examples
git clone -b v$RELEASE https://github.com/ollama/ollama.git

# old method via llama.cpp
sudo tdnf install -y git-lfs git
git lfs install
cd $HOME/ollama/examples/langchain-python-rag-privategpt
git clone -b b2536 https://github.com/ggerganov/llama.cpp.git
cd llama.cpp
pip3 install -r requirements.txt

# Use LLM: google-bert/bert-base-german-cased
export Model=bert-base-german-cased
export HuggingFacePath=https://huggingface.co/google-bert
git clone $HuggingFacePath/$Model
cp ./$Model/config.json ./$Model/config.json.1
sed "s/BertForMaskedLM/BertModel/" ./$Model/config.json.1 > ./$Model/config.json
rm ./$Model/config.json.1
python3 convert-hf-to-gguf.py ./$Model --outfile ./models/$Model.gguf --outtype f32
cd models
sudo cat <<EOF | sudo tee ./Modelfile
FROM ./bert-base-german-cased.gguf
EOF
ollama create bert-base-german-cased -f ./Modelfile
cd ..
cd ..

ollama create fails with the issue. The method is biased to the old llama.cpp b2536 release. In my case, bert-based-german-cased with the workaround does not work anymore.

Well, the main goal is make work embeddings models. Beside English and Chinese, especially European languages are not widespread in the meaning of fully functional embeddings models in Ollama. E.g. the goal in https://github.com/ollama/ollama/issues/3747 was to make work Dutch,

With a newer version e.g. b3505, a BPE pre-tokenization is necessary, see reference.

In https://github.com/ggerganov/llama.cpp/blob/master/convert_hf_to_gguf.py in the get_vocab_base_pre function, there are more than twenty embeddings models included, but not for bert-based-german-cased or Dutch, French, Spanish, Italian, etc.

If there is an easy fix for the utf-8 issue, that would help of course.

<!-- gh-comment-id:2266653784 --> @dcasota commented on GitHub (Aug 3, 2024): Hi @joshyan1, Here a recipe extract to reproduce the issue. ``` cd $HOME export RELEASE=0.3.3 echo Installing Ollama Release $RELEASE ... curl -fsSL https://ollama.com/install.sh | sed "s#https://ollama.com/download#https://github.com/ollama/ollama/releases/download/v\$RELEASE#" | sh # Get the Ollama source examples git clone -b v$RELEASE https://github.com/ollama/ollama.git # old method via llama.cpp sudo tdnf install -y git-lfs git git lfs install cd $HOME/ollama/examples/langchain-python-rag-privategpt git clone -b b2536 https://github.com/ggerganov/llama.cpp.git cd llama.cpp pip3 install -r requirements.txt # Use LLM: google-bert/bert-base-german-cased export Model=bert-base-german-cased export HuggingFacePath=https://huggingface.co/google-bert git clone $HuggingFacePath/$Model cp ./$Model/config.json ./$Model/config.json.1 sed "s/BertForMaskedLM/BertModel/" ./$Model/config.json.1 > ./$Model/config.json rm ./$Model/config.json.1 python3 convert-hf-to-gguf.py ./$Model --outfile ./models/$Model.gguf --outtype f32 cd models sudo cat <<EOF | sudo tee ./Modelfile FROM ./bert-base-german-cased.gguf EOF ollama create bert-base-german-cased -f ./Modelfile cd .. cd .. ``` `ollama create` fails with the issue. The method is biased to the old llama.cpp b2536 release. In my case, `bert-based-german-cased` with the workaround does not work anymore. Well, the main goal is make work embeddings models. Beside English and Chinese, especially European languages are not widespread in the meaning of fully functional embeddings models in Ollama. E.g. the goal in https://github.com/ollama/ollama/issues/3747 was to make work Dutch, With a newer version e.g. b3505, a BPE pre-tokenization is necessary, see [reference](https://github.com/ggerganov/llama.cpp/pull/6920). In `https://github.com/ggerganov/llama.cpp/blob/master/convert_hf_to_gguf.py` in the `get_vocab_base_pre` function, there are more than twenty embeddings models included, but not for `bert-based-german-cased` or Dutch, French, Spanish, Italian, etc. If there is an easy fix for the utf-8 issue, that would help of course.
Author
Owner

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

I had the same issue

<!-- gh-comment-id:2329337850 --> @manuelcaccone commented on GitHub (Sep 4, 2024): I had the same issue
Author
Owner

@CjhHa1 commented on GitHub (Sep 10, 2024):

I had the same issue

you can check the file you use and see if it is just a link but not the real gguf

<!-- gh-comment-id:2341383637 --> @CjhHa1 commented on GitHub (Sep 10, 2024): > I had the same issue you can check the file you use and see if it is just a link but not the real gguf
Author
Owner

@ertghiu256 commented on GitHub (Dec 12, 2024):

I had the same problem

<!-- gh-comment-id:2537987057 --> @ertghiu256 commented on GitHub (Dec 12, 2024): I had the same problem
Author
Owner

@jieguolove commented on GitHub (Dec 26, 2024):

the same problem

root@27d10c6f52c8:~/.ollama/TeleChat2-35B-Nov# ollama --version
ollama version is 0.4.5

root@27d10c6f52c8:~/.ollama/TeleChat2-35B-Nov# more Modelfile
from config.json
from configuration.json
from configuration_telechat2.py
from generation_config.json
from generation_utils.py
from modeling_telechat2.py
from pytorch_model.bin.index.json
from pytorch_model_00001-of-00008.bin
from pytorch_model_00002-of-00008.bin
from pytorch_model_00003-of-00008.bin
from pytorch_model_00004-of-00008.bin
from pytorch_model_00005-of-00008.bin
from pytorch_model_00006-of-00008.bin
from pytorch_model_00007-of-00008.bin
from pytorch_model_00008-of-00008.bin
from tokenization_telechat2.py
from tokenizer.model
from tokenizer_config.json

root@27d10c6f52c8:~/.ollama/TeleChat2-35B-Nov# ollama create telechat -f Modelfile
transferring model data 100%
Error: unsupported content type: text/plain; charset=utf-8

<!-- gh-comment-id:2562161148 --> @jieguolove commented on GitHub (Dec 26, 2024): the same problem root@27d10c6f52c8:~/.ollama/TeleChat2-35B-Nov# ollama --version ollama version is 0.4.5 root@27d10c6f52c8:~/.ollama/TeleChat2-35B-Nov# more Modelfile from config.json from configuration.json from configuration_telechat2.py from generation_config.json from generation_utils.py from modeling_telechat2.py from pytorch_model.bin.index.json from pytorch_model_00001-of-00008.bin from pytorch_model_00002-of-00008.bin from pytorch_model_00003-of-00008.bin from pytorch_model_00004-of-00008.bin from pytorch_model_00005-of-00008.bin from pytorch_model_00006-of-00008.bin from pytorch_model_00007-of-00008.bin from pytorch_model_00008-of-00008.bin from tokenization_telechat2.py from tokenizer.model from tokenizer_config.json root@27d10c6f52c8:~/.ollama/TeleChat2-35B-Nov# ollama create telechat -f Modelfile transferring model data 100% Error: unsupported content type: text/plain; charset=utf-8
Author
Owner

@k2rw commented on GitHub (Jan 18, 2025):

Hello everyone!
Somehow the problem was solved along with the OLLAMA version upgrade.
I want to thank all of you for your comments.

<!-- gh-comment-id:2600159918 --> @k2rw commented on GitHub (Jan 18, 2025): Hello everyone! Somehow the problem was solved along with the OLLAMA version upgrade. I want to thank all of you for your comments.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/ollama#65538