Skip to content

Commit

Permalink
*.py: add compilade warning suggestions and style fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
mofosyne committed May 3, 2024
1 parent 08e2b77 commit 52d0567
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 5 deletions.
4 changes: 2 additions & 2 deletions convert-hf-to-gguf.py
Original file line number Diff line number Diff line change
Expand Up @@ -2363,7 +2363,7 @@ def set_vocab(self):
# TODO: this is a hack, should be fixed
# https://github.com/ggerganov/llama.cpp/pull/6745#issuecomment-2067687048
special_vocab.special_token_ids["eos"] = self._try_get_sft_eos(tokenizer)
logger.debug(f"Replace eos:{old_eos} with a special token:{special_vocab.special_token_ids['eos']} \
logger.warning(f"Replace eos:{old_eos} with a special token:{special_vocab.special_token_ids['eos']} \
in chat mode so that the conversation can end normally.")

special_vocab.add_to_gguf(self.gguf_writer)
Expand Down Expand Up @@ -2691,7 +2691,7 @@ def set_vocab(self):
else:
# Use the GPT-NeoX tokenizer when no tokenizer files are present
tokenizer_path = Path(sys.path[0]) / "models" / "ggml-vocab-gpt-neox.gguf"
logger.debug(f"Using tokenizer from '{os.path.relpath(tokenizer_path, os.getcwd())}'")
logger.warning(f"Using tokenizer from '{os.path.relpath(tokenizer_path, os.getcwd())}'")
neox_reader = gguf.GGUFReader(tokenizer_path, "r")

field = neox_reader.get_field(gguf.Keys.Tokenizer.MODEL)
Expand Down
2 changes: 1 addition & 1 deletion convert-llama-ggml-to-gguf.py
Original file line number Diff line number Diff line change
Expand Up @@ -402,7 +402,7 @@ def handle_args():
help="directory containing tokenizer.model, if separate from model file - only meaningful with --model-metadata-dir")
parser.add_argument("--vocabtype", default="spm,hfft",
help="vocab format - only meaningful with --model-metadata-dir and/or --vocab-dir (default: spm,hfft)")
parser.add_argument("--verbose", action="store_true", help="increase output verbosity")
parser.add_argument("--verbose", action="store_true", help="increase output verbosity")
return parser.parse_args()


Expand Down
2 changes: 1 addition & 1 deletion gguf-py/scripts/gguf-convert-endian.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ def main() -> None:
"--dry-run", action="store_true",
help="Don't actually change anything",
)
parser.add_argument("--verbose", action="store_true", help="increase output verbosity")
parser.add_argument("--verbose", action="store_true", help="increase output verbosity")

args = parser.parse_args(None if len(sys.argv) > 1 else ["--help"])

Expand Down
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
#

-r ./requirements/requirements-convert.txt

-r ./requirements/requirements-convert-hf-to-gguf.txt
-r ./requirements/requirements-convert-hf-to-gguf-update.txt
-r ./requirements/requirements-convert-llama-ggml-to-gguf.txt
Expand Down
2 changes: 1 addition & 1 deletion scripts/run-with-preset.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
parser.add_argument("yaml_files", nargs="*",
help="Arbitrary number of YAML files from which to read preset values. "
"If two files specify the same values the later one will be used.")
parser.add_argument("--verbose", action="store_true", help="increase output verbosity")
parser.add_argument("--verbose", action="store_true", help="increase output verbosity")

known_args, unknown_args = parser.parse_known_args()

Expand Down

0 comments on commit 52d0567

Please sign in to comment.