Skip to content

Commit

Permalink
chore: Remove rebase artifacts
Browse files Browse the repository at this point in the history
  • Loading branch information
ditsuke authored and SomeoneSerge committed Jul 4, 2024
1 parent 07786a6 commit 01a5f06
Show file tree
Hide file tree
Showing 7 changed files with 7 additions and 310 deletions.
20 changes: 7 additions & 13 deletions convert_hf_to_gguf_update.py
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ class TOKENIZER_TYPE(IntEnum):

# TODO: this string has to exercise as much pre-tokenizer functionality as possible
# will be updated with time - contributions welcome
chktxt = "\n \n\n \n\n\n \t \t\t \t\n \n \n \n \n🚀 (normal) 😶‍🌫️ (multiple emojis concatenated) ✅ 🦙🦙 3 33 333 3333 33333 333333 3333333 33333333 3.3 3..3 3...3 កាន់តែពិសេសអាច😁 ?我想在apple工作1314151天~ ------======= нещо на Български ''''''```````\"\"\"\"......!!!!!!?????? I've been 'told he's there, 'RE you sure? 'M not sure I'll make it, 'D you like some tea? We'Ve a'lL"
chktxt = '\n \n\n \n\n\n \t \t\t \t\n \n \n \n \n🚀 (normal) 😶‍🌫️ (multiple emojis concatenated) ✅ 🦙🦙 3 33 333 3333 33333 333333 3333333 33333333 3.3 3..3 3...3 កាន់តែពិសេសអាច😁 ?我想在apple工作1314151天~ ------======= нещо на Български \'\'\'\'\'\'```````\"\"\"\"......!!!!!!?????? I\'ve been \'told he\'s there, \'RE you sure? \'M not sure I\'ll make it, \'D you like some tea? We\'Ve a\'lL'

if len(sys.argv) == 2:
token = sys.argv[1]
Expand Down Expand Up @@ -99,7 +99,7 @@ def download_file_with_auth(url, token, save_path):
response = sess.get(url, headers=headers)
response.raise_for_status()
os.makedirs(os.path.dirname(save_path), exist_ok=True)
with open(save_path, "wb") as f:
with open(save_path, 'wb') as f:
f.write(response.content)
logger.info(f"File {save_path} downloaded successfully")

Expand Down Expand Up @@ -156,9 +156,7 @@ def download_model(model):
else:
tokenizer = AutoTokenizer.from_pretrained(f"models/tokenizers/{name}")
except OSError as e:
logger.error(
f"Error loading tokenizer for model {name}. The model may not exist or is not accessible with the provided token. Error: {e}"
)
logger.error(f"Error loading tokenizer for model {name}. The model may not exist or is not accessible with the provided token. Error: {e}")
continue # Skip to the next model if the tokenizer can't be loaded

chktok = tokenizer.encode(chktxt)
Expand All @@ -178,15 +176,13 @@ def download_model(model):
pre_tokenizer = cfg["pre_tokenizer"]
logger.info("pre_tokenizer: " + json.dumps(pre_tokenizer, indent=4))
if "ignore_merges" in cfg["model"]:
logger.info(
"ignore_merges: " + json.dumps(cfg["model"]["ignore_merges"], indent=4)
)
logger.info("ignore_merges: " + json.dumps(cfg["model"]["ignore_merges"], indent=4))

logger.info("")

src_ifs += f' if chkhsh == "{chkhsh}":\n'
src_ifs += f" if chkhsh == \"{chkhsh}\":\n"
src_ifs += f" # ref: {model['repo']}\n"
src_ifs += f' res = "{name}"\n'
src_ifs += f" res = \"{name}\"\n"

src_func = f"""
def get_vocab_base_pre(self, tokenizer) -> str:
Expand Down Expand Up @@ -347,8 +343,6 @@ def get_vocab_base_pre(self, tokenizer) -> str:
for model in models:
name = model["name"]

print(
f"python3 convert-hf-to-gguf.py models/tokenizers/{name}/ --outfile models/ggml-vocab-{name}.gguf --vocab-only"
) # noqa: NP100
print(f"python3 convert-hf-to-gguf.py models/tokenizers/{name}/ --outfile models/ggml-vocab-{name}.gguf --vocab-only") # noqa: NP100

logger.info("\n")
149 changes: 0 additions & 149 deletions convert_lora_to_ggml.py

This file was deleted.

137 changes: 0 additions & 137 deletions convert_persimmon_to_gguf.py

This file was deleted.

3 changes: 0 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,4 @@ build-backend = "poetry.core.masonry.api"
[tool.poetry.scripts]
llama-convert-hf-to-gguf = "convert_hf_to_gguf:main"
llama-convert-llama-ggml-to-gguf = "convert_llama_ggml_to_gguf:main"
llama-convert-lora-to-ggml = "convert_lora_to_ggml:main"
llama-convert-persimmon-to-gguf = "convert_persimmon_to_gguf:main"
llama-convert = "convert:main"
llama-ggml-vk-generate-shaders = "ggml_vk_generate_shaders:main"
2 changes: 0 additions & 2 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,3 @@
-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
-r ./requirements/requirements-convert_lora_to_ggml.txt
-r ./requirements/requirements-convert_persimmon_to_gguf.txt
3 changes: 0 additions & 3 deletions requirements/requirements-convert_lora_to_ggml.txt

This file was deleted.

3 changes: 0 additions & 3 deletions requirements/requirements-convert_persimmon_to_gguf.txt

This file was deleted.

0 comments on commit 01a5f06

Please sign in to comment.