[GH-ISSUE #6234] File Name with Empty Space Will Not be Recognize #65936

Closed
opened 2026-05-03 23:14:22 -05:00 by GiteaMirror · 6 comments
Owner

Originally created by @Mo-enen on GitHub (Aug 7, 2024).
Original GitHub issue: https://github.com/ollama/ollama/issues/6234

As the image below shows:
The Chinese content is the correct response from the LLM. Not an error message.

error

OS

Windows

Ollama version

0.3.4

Originally created by @Mo-enen on GitHub (Aug 7, 2024). Original GitHub issue: https://github.com/ollama/ollama/issues/6234 As the image below shows: The Chinese content is the correct response from the LLM. Not an error message. ![error](https://github.com/user-attachments/assets/83276219-8c15-4b1d-89f2-0f8996889376) ### OS Windows ### Ollama version 0.3.4
GiteaMirror added the bug label 2026-05-03 23:14:22 -05:00
Author
Owner

@rick-github commented on GitHub (Aug 7, 2024):

This seems like a windows issue. What happens if you type

echo < "C:\Users\Mo_enen\Desktop\Test Input.txt"
<!-- gh-comment-id:2273993383 --> @rick-github commented on GitHub (Aug 7, 2024): This seems like a windows issue. What happens if you type ``` echo < "C:\Users\Mo_enen\Desktop\Test Input.txt" ```
Author
Owner

@igorschlum commented on GitHub (Aug 7, 2024):

@rick-github good point
I asked ChatGPT, and the correct Windows command seems to be:

type "C:\Users\Mo_enen\Desktop\Test Input.txt"

ChatGPT says that it is correct to have spaces in the file path as long as they are surrounded by quotes, so the problem might be in Ollama.

<!-- gh-comment-id:2274004238 --> @igorschlum commented on GitHub (Aug 7, 2024): @rick-github good point I asked ChatGPT, and the correct Windows command seems to be: ```bash type "C:\Users\Mo_enen\Desktop\Test Input.txt" ``` ChatGPT says that it is correct to have spaces in the file path as long as they are surrounded by quotes, so the problem might be in Ollama.
Author
Owner

@rick-github commented on GitHub (Aug 7, 2024):

I wanted the OP to test the redirection, hence echo <. The quoting is the correct way to use files with embedded spaces, so my suspicion is that the path is not correct, or there is some non-visible embedded characters in the path: ie, the "space" might not actually be a space, but some other Simplified Chinese glyph that looks like a space.

<!-- gh-comment-id:2274027639 --> @rick-github commented on GitHub (Aug 7, 2024): I wanted the OP to test the redirection, hence `echo <`. The quoting is the correct way to use files with embedded spaces, so my suspicion is that the path is not correct, or there is some non-visible embedded characters in the path: ie, the "space" might not actually be a space, but some other Simplified Chinese glyph that looks like a space.
Author
Owner

@igorschlum commented on GitHub (Aug 7, 2024):

@rick-github OK echo c gives the first line and type print the full file. Good idea to check if the file really exist.

<!-- gh-comment-id:2274397905 --> @igorschlum commented on GitHub (Aug 7, 2024): @rick-github OK echo c gives the first line and type print the full file. Good idea to check if the file really exist.
Author
Owner

@Mo-enen commented on GitHub (Aug 8, 2024):

I tested again. It all works now. The echo < prints "ECHO is on" and ollama run gives the correct result.
I restart the os, deleted the file and created a same new one. I don't know what exactly fixed it. Maybe there's a invisible char in the file name, or I just need to restart after install ollama for the first time.
Snipaste_2024-08-08_15-25-52

<!-- gh-comment-id:2275146151 --> @Mo-enen commented on GitHub (Aug 8, 2024): I tested again. It all works now. The `echo <` prints "ECHO is on" and ollama run gives the correct result. I restart the os, deleted the file and created a same new one. I don't know what exactly fixed it. Maybe there's a invisible char in the file name, or I just need to restart after install ollama for the first time. ![Snipaste_2024-08-08_15-25-52](https://github.com/user-attachments/assets/00794737-f6bd-4959-8b92-6c4141d5c156)
Author
Owner

@Mo-enen commented on GitHub (Aug 8, 2024):

It's a invisible char in the file name. It caused a line wrap and hide itself. New file I create don't have the line wrap.
123

<!-- gh-comment-id:2275156483 --> @Mo-enen commented on GitHub (Aug 8, 2024): It's a invisible char in the file name. It caused a line wrap and hide itself. New file I create don't have the line wrap. ![123](https://github.com/user-attachments/assets/c17b8842-29a4-4b2e-87a9-f93a64eb6727)
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/ollama#65936