Skip to content

Commit

Permalink
Merge pull request #577 from UKP-SQuARE/fix-skill-creation
Browse files Browse the repository at this point in the history
Fix skill creation
  • Loading branch information
HaritzPuerto authored May 2, 2024
2 parents a680eb1 + 59e3899 commit 88bbc1e
Show file tree
Hide file tree
Showing 10 changed files with 23 additions and 11 deletions.
7 changes: 6 additions & 1 deletion frontend/src/views/Skill.vue
Original file line number Diff line number Diff line change
Expand Up @@ -577,7 +577,12 @@ export default Vue.component('edit-skill', {
this.validJSON = false
}
}

if (this.skill.url == 'http://extractive-qa' || this.skill.url == 'http://open-extractive-qa' || this.skill.url == 'http://multiple-choice-qa' || this.skill.url == 'http://information-retrieval') {
this.skill.default_skill_args['base_model'] = this.skill.models.reader_model
}
if (this.skill.url == 'http://generative-qa') {
this.skill.default_skill_args['base_model'] = this.skill.models.generator
}
},
addSkillAgents() {
this.skill.default_skill_args['list_skills'] = []
Expand Down
2 changes: 1 addition & 1 deletion local_deploy/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ tqdm
square-auth==0.0.14
faiss-instant
docker
square-model-client
git+https://github.com/UKP-SQuARE/square-model-client.git@main#egg=square-model-client
6 changes: 3 additions & 3 deletions model-manager/model_manager/app/models/management.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@ class DeployRequest(BaseModel):
disable_gpu: Optional[bool] = Field(
True, description="whether to use gpu for inference"
)
batch_size: int = Field("", description="input batch size")
max_input: int = Field("", description="max input length")
batch_size: int = Field(32, description="input batch size")
max_input: int = Field(512, description="max input length")
transformers_cache: Optional[str] = Field(
"../.cache", description="path to cache models"
)
Expand All @@ -83,7 +83,7 @@ class DeployRequest(BaseModel):
)

model_class: str = Field(
"",
"from_config",
description="See square_model_inference.inference.transformer.CLASS_MAPPING "
"for valid names and corresponding class",
)
Expand Down
4 changes: 2 additions & 2 deletions model-manager/model_manager/app/routers/management.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,8 @@ async def get_all_models(): # token: str = Depends(client_credentials)):
model_type=model["MODEL_TYPE"],
model_name=model["MODEL_NAME"],
disable_gpu=model["DISABLE_GPU"],
batch_size=model["BATCH_SIZE"],
max_input=model["MAX_INPUT_SIZE"],
batch_size=model.get("BATCH_SIZE", 32),
max_input=model.get("MAX_INPUT_SIZE", 512),
model_class=model["MODEL_CLASS"],
return_plaintext_arrays=model["RETURN_PLAINTEXT_ARRAYS"],
)
Expand Down
1 change: 0 additions & 1 deletion model-manager/model_manager/tasks/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,6 @@ def remove_model_task(self, identifier):
container_id = c["CONTAINER"]
logger.info("Starting to remove docker container %s", container_id)
result = remove_model_container(container_id)
if result:
asyncio.run(self.client.remove_model_db(identifier))
return {"success": result, "message": "Model removal successful"}
except Exception as e:
Expand Down
4 changes: 3 additions & 1 deletion skill-manager/.local.env
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,6 @@ MONGO_INITDB_ROOT_PASSWORD=mongo-local-pw
REDIS_USER=default
REDIS_PASSWORD=redis-local-pw
CLIENT_SECRET=skill-manager-local-pw
EVALUATOR_API_URL=https://square.ukp-lab.de/api/evaluator
EVALUATOR_API_URL=https://test.square.ukp-lab.de/api/evaluator
SQUARE_URL=https://test.square.ukp-lab.de
SQUARE_API_URL=https://test.square.ukp-lab.de/api
3 changes: 3 additions & 0 deletions skill-manager/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ WORKDIR /app
COPY requirements.txt requirements.txt
RUN pip install -r requirements.txt

# COPY ./square-model-client /square-model-client
# RUN pip install -e /square-model-client

COPY ./skill_manager skill_manager

COPY logging.conf logging.conf
Expand Down
3 changes: 3 additions & 0 deletions skill-manager/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,9 @@ build:
logs:
docker compose --env-file .local.env logs -f skill-manager

build-up:
make build
make up

# COLORS
GREEN := $(shell tput -Txterm setaf 2)
Expand Down
2 changes: 1 addition & 1 deletion skill-manager/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ square-auth==0.0.14
square-elk-json-formatter==0.0.3
square-skill-api==0.0.47
uvicorn==0.20.0
square-model-client==0.0.10
git+https://github.com/UKP-SQuARE/square-model-client.git@main#egg=square-model-client
2 changes: 1 addition & 1 deletion skills/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
square-elk-json-formatter==0.0.3
square-datastore-client==0.0.3
square-model-client==0.0.10
git+https://github.com/UKP-SQuARE/square-model-client.git@main#egg=square-model-client
square-skill-api==0.0.47
requests==2.28.2

0 comments on commit 88bbc1e

Please sign in to comment.