Skip to content

Commit

Permalink
fix: Update Mistral Version and Rebuild (#501)
Browse files Browse the repository at this point in the history
**Reason for Change**:
Update model version and Address missing weights files fix
  • Loading branch information
ishaansehgal99 authored Jul 10, 2024
1 parent d601ae8 commit e4849a1
Show file tree
Hide file tree
Showing 9 changed files with 46 additions and 26 deletions.
8 changes: 8 additions & 0 deletions .github/actions/build-image-action/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,12 @@ inputs:
model_runtime:
description: "Model runtime"
required: true
hf_username:
description: "HuggingFace Username"
required: true
hf_token:
description: "HuggingFace Token"
required: true
runs_on:
description: "The runner to use"
required: true
Expand Down Expand Up @@ -141,6 +147,8 @@ runs:
MODEL_RUNTIME=${{ inputs.model_runtime }} \
MODEL_TAG=${{ inputs.image_tag }} \
WEIGHTS_DIR=${{ inputs.weights_dir }} \
HF_USERNAME=${{ inputs.hf_username }} \
HF_TOKEN=${{ inputs.hf_token }} \
python3 .github/workflows/kind-cluster/main.py
shell: bash

Expand Down
9 changes: 7 additions & 2 deletions .github/workflows/kind-cluster/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,12 @@ def get_kubectl_path():
raise FileNotFoundError("kubectl not found at /usr/local/bin/kubectl")
return kubectl_path

def get_model_git_info(model_version):
def get_model_git_info(model_version, hf_username, hf_token):
"""Get model Git Repo link and commit ID"""
url_parts = model_version.split('/')
# Add Auth to URL
if hf_username and hf_token:
url_parts[2] = f'{hf_username}:{hf_token}@{url_parts[2]}'
model_url = '/'.join(url_parts[:-2])
commit_id = url_parts[-1]
return model_url, commit_id
Expand Down Expand Up @@ -106,9 +109,11 @@ def main():
model_runtime = os.environ.get("MODEL_RUNTIME", None)
model_type = os.environ.get("MODEL_TYPE", None)
model_tag = os.environ.get("MODEL_TAG", None)
hf_username = os.environ.get("HF_USERNAME", None)
hf_token = os.environ.get("HF_TOKEN", None)

if model_version:
model_url, model_commit = get_model_git_info(model_version)
model_url, model_commit = get_model_git_info(model_version, hf_username, hf_token)
download_new_model(model_name, model_url)
update_model(model_name, model_commit)
clone_and_checkout_pr_branch(pr_branch)
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/preset-image-build-1ES.yml
Original file line number Diff line number Diff line change
Expand Up @@ -226,4 +226,6 @@ jobs:
model_type: ${{ matrix.model.type }}
model_version: ${{ matrix.model.version }}
model_runtime: ${{ matrix.model.runtime }}
hf_username: ${{ secrets.HF_USERNAME }}
hf_token: ${{ secrets.HF_TOKEN }}
runs_on: "1ES.Pool=1es-aks-kaito-image-build-agent-pool-ubuntu"
2 changes: 2 additions & 0 deletions .github/workflows/preset-image-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -122,4 +122,6 @@ jobs:
model_type: ${{ matrix.model.type }}
model_version: ${{ matrix.model.version }}
model_runtime: ${{ matrix.model.runtime }}
hf_username: ${{ secrets.HF_USERNAME }}
hf_token: ${{ secrets.HF_TOKEN }}
runs_on: "hostname:model-server"
1 change: 1 addition & 0 deletions presets/inference/text-generation/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ pydantic>=2.7.1,<2.8 # Allow patch updates
uvicorn[standard]>=0.29.0,<0.30.0 # Allow patch updates
peft==0.11.1
numpy==1.22.4
sentencepiece==0.2.0

# Utility libraries
bitsandbytes==0.42.0
Expand Down
4 changes: 2 additions & 2 deletions presets/models/mistral/model.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ var (
PresetMistral7BInstructModel = PresetMistral7BModel + "-instruct"

PresetMistralTagMap = map[string]string{
"Mistral7B": "0.0.5",
"Mistral7BInstruct": "0.0.5",
"Mistral7B": "0.0.6",
"Mistral7BInstruct": "0.0.6",
}

baseCommandPresetMistral = "accelerate launch"
Expand Down
9 changes: 5 additions & 4 deletions presets/models/supported_models.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -67,15 +67,16 @@ models:
# Mistral
- name: mistral-7b
type: text-generation
version: https://huggingface.co/mistralai/Mistral-7B-v0.1/commit/26bca36bde8333b5d7f72e9ed20ccda6a618af24
version: https://huggingface.co/mistralai/Mistral-7B-v0.3/commit/c882233d224d27b727b3d9299b12a9aab9dda6f7
runtime: tfs
tag: 0.0.5
tag: 0.0.6
- name: mistral-7b-instruct
type: text-generation
version: https://huggingface.co/mistralai/Mistral-7B-Instruct-v0.2/commit/b70aa86578567ba3301b21c8a27bea4e8f6d6d61
version: https://huggingface.co/mistralai/Mistral-7B-Instruct-v0.3/commit/0417f4babd26db0b5ed07c1d0bc85658ab526ea3
runtime: tfs
tag: 0.0.5
tag: 0.0.6
# Tag history:
# 0.0.6 - Update model version and Address missing weights files fix
# 0.0.5 - Tuning and Adapters
# 0.0.4 - Adjust default model params (#310)
# 0.0.3 - Update Default Params (#294)
Expand Down
1 change: 1 addition & 0 deletions presets/tuning/text-generation/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ uvicorn[standard]>=0.29.0,<0.30.0 # Allow patch updates
datasets==2.19.1
peft==0.11.1
bitsandbytes==0.42.0
sentencepiece==0.2.0

# Less critical, can be latest
loralib
Expand Down
36 changes: 18 additions & 18 deletions test/e2e/preset_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -581,24 +581,24 @@ var _ = Describe("Workspace Preset", func() {
}
})

//It("should create a mistral workspace with preset public mode successfully", func() {
// numOfNode := 1
// workspaceObj := createMistralWorkspaceWithPresetPublicMode(numOfNode)
//
// defer cleanupResources(workspaceObj)
// time.Sleep(30 * time.Second)
//
// validateMachineCreation(workspaceObj, numOfNode)
// validateResourceStatus(workspaceObj)
//
// time.Sleep(30 * time.Second)
//
// validateAssociatedService(workspaceObj)
//
// validateInferenceResource(workspaceObj, int32(numOfNode), false)
//
// validateWorkspaceReadiness(workspaceObj)
//})
It("should create a mistral workspace with preset public mode successfully", func() {
numOfNode := 1
workspaceObj := createMistralWorkspaceWithPresetPublicMode(numOfNode)

defer cleanupResources(workspaceObj)
time.Sleep(30 * time.Second)

validateMachineCreation(workspaceObj, numOfNode)
validateResourceStatus(workspaceObj)

time.Sleep(30 * time.Second)

validateAssociatedService(workspaceObj)

validateInferenceResource(workspaceObj, int32(numOfNode), false)

validateWorkspaceReadiness(workspaceObj)
})

It("should create a Phi-2 workspace with preset public mode successfully", func() {
numOfNode := 1
Expand Down

0 comments on commit e4849a1

Please sign in to comment.