Skip to content

Conversation

@dmikey
Copy link
Contributor

@dmikey dmikey commented Aug 30, 2023

add flushes after printf statements, so that stdout will throw events and log in real time.

if not flushed, stuck in buffer for other processes until this finishes.

this fixes for example using sd | tee output.txt

fixes building UI tools without need for ABI/RPC (formatted logging probably ideal next)

Screenshot 2023-08-29 at 10 25 28 PM

@fwsGonzo
Copy link

I also had to do this for a strange environment I am working in. I didn't create a PR because I don't know if this is something that everyone wants, but it helped me see how far I got with the memory constraints I have.

@leejet
Copy link
Owner

leejet commented Aug 30, 2023

Thanks for your contribution

@leejet leejet merged commit 1b5a868 into leejet:master Aug 30, 2023
rmatif pushed a commit to rmatif/stable-diffusion.cpp that referenced this pull request Apr 8, 2025
Enable prompt input through pipe, instead of using -p option.
This makes easier to give longer and multiple lines for the prompt.

Test:
 $ echo "This is an example" > prompt.txt
 $ cat prompt.txt | ./bin/gpt-j -m models/gpt-j-6B/ggml-model.bin
 $ cat promot.txt | ./bin/gpt-2 -m models/gpt-2-117M/ggml-model.bin

Note that -p option and no -p specified case are kept.
 $ ./bin/gpt-j -m models/gpt-j-6B/ggml-model.bin -p "This is an example"
 $ ./bin/gpt-j -m models/gpt-j-6B/ggml-model.bin
 $ ./bin/gpt-2 -m models/gpt-2-117M/ggml-model.bin -p "This is an example"
 $ ./bin/gpt-2 -m models/gpt-2-117M/ggml-model.bin
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants