From 44f43f5adfb72325876d0f8a49c6ba08ffd56d58 Mon Sep 17 00:00:00 2001 From: april-yyt Date: Mon, 19 Feb 2024 13:55:57 +0000 Subject: [PATCH] rebase on peft --- python/flexflow/serve/serve.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/python/flexflow/serve/serve.py b/python/flexflow/serve/serve.py index 42cee2aa80..2d61461421 100644 --- a/python/flexflow/serve/serve.py +++ b/python/flexflow/serve/serve.py @@ -406,14 +406,21 @@ def __load_hf_weights(self): def upload_hf_model(self, new_model_id: str, model_path:str, private: bool = False): """ +<<<<<<< HEAD Uploads the model to the Hugging Face Hub, with reverse conversion of weights. +======= + Uploads the model weights to the Hugging Face Hub, with reverse conversion of weights. +>>>>>>> cdf24eb0 (modify upload logic and add reconvert functions for opt models) :param new_model_id: The new model ID for the Hugging Face Hub. :param model_path: The path where the FlexFlow weights are stored. :param private: Whether to upload the model as a private model. """ print(f"Preparing model for upload to Hugging Face Hub: {new_model_id}") +<<<<<<< HEAD print("tokenizer path is: ", self.tokenizer_path) +======= +>>>>>>> cdf24eb0 (modify upload logic and add reconvert functions for opt models) # Initialize a new Hugging Face model instance hf_model = AutoModelForCausalLM.from_config(self.hf_config) @@ -430,6 +437,7 @@ def upload_hf_model(self, new_model_id: str, model_path:str, private: bool = Fal temp_dir = tempfile.mkdtemp() hf_model.save_pretrained(temp_dir) +<<<<<<< HEAD # Copy the tokenizer files to the temporary directory tokenizer_files = [f for f in os.listdir(self.tokenizer_path)] for file_name in tokenizer_files: @@ -440,6 +448,8 @@ def upload_hf_model(self, new_model_id: str, model_path:str, private: bool = Fal if os.path.exists(rev_sha_path): os.remove(rev_sha_path) +======= +>>>>>>> cdf24eb0 (modify upload logic and add reconvert functions for opt models) # Ensure Hugging Face CLI is logged in if not HfFolder.get_token(): print("Hugging Face token not found. Please login using `huggingface-cli login`.")