Skip to content

Commit

Permalink
Merge pull request #247 from deeppavlov/dev
Browse files Browse the repository at this point in the history
Release v0.5.0
  • Loading branch information
dilyararimovna authored Dec 2, 2022
2 parents 5c36b99 + 15eb1bd commit 2961057
Show file tree
Hide file tree
Showing 76 changed files with 2,268 additions and 538 deletions.
5 changes: 0 additions & 5 deletions annotators/ConversationEvaluator/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,10 @@ FROM deeppavlov/base-gpu:0.12.0
RUN pip install --upgrade pip && pip install git+https://github.com/deeppavlov/DeepPavlov.git@0.12.0

ARG CONFIG
ARG DATA_URL=http://files.deeppavlov.ai/alexaprize_data/cobot_conveval2.tar.gz
ARG PORT
ENV CONFIG=$CONFIG
ENV PORT=$PORT

ADD $DATA_URL /tmp

RUN tar -xvzf /tmp/*.tar.gz -C /tmp/

WORKDIR /src
RUN mkdir common

Expand Down
17 changes: 14 additions & 3 deletions annotators/ConversationEvaluator/conveval.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,14 +41,25 @@
}
]
},
"train": {
"batch_size": 64
},
"metadata": {
"variables": {
"MODEL_PATH": "/tmp",
"MODEL_NAME": "model"
"variables": {
"ROOT_PATH": "~/.deeppavlov",
"DOWNLOADS_PATH": "{ROOT_PATH}/downloads",
"MODELS_PATH": "{ROOT_PATH}/models",
"MODEL_PATH": "{MODELS_PATH}/classifiers/cobot_conveval2"
},
"requirements": [
"{DEEPPAVLOV_PATH}/requirements/tf.txt",
"{DEEPPAVLOV_PATH}/requirements/bert_dp.txt"
],
"download": [
{
"url": "http://files.deeppavlov.ai/alexaprize_data/cobot_conveval2.tar.gz",
"subdir": "{MODELS_PATH}/classifiers"
}
]
}
}
5 changes: 3 additions & 2 deletions annotators/ConversationEvaluator/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
from sentry_sdk.integrations.flask import FlaskIntegration
from deeppavlov import build_model

logging.basicConfig(format="%(asctime)s - %(name)s - %(levelname)s - %(message)s", level=logging.INFO)
logger = logging.getLogger(__name__)
sentry_sdk.init(dsn=os.getenv("SENTRY_DSN"), integrations=[FlaskIntegration()])

Expand All @@ -25,7 +26,7 @@ def transform(data):


try:
model = build_model("conveval.json", download=False)
model = build_model("conveval.json", download=True)
test_res = model(["a"])
logger.info("model loaded, test query processed")
except Exception as e:
Expand All @@ -51,7 +52,7 @@ def batch_respond():
result = []
for scores in conv_eval_results:
result.append({annotation: float(score) for annotation, score in zip(key_annotations, scores)})
logger.info(f"Conv eval exec time {round(time.time()-t, 2)} sec")
logger.info(f"convers_evaluator_annotator exec time {round(time.time()-t, 2)} sec")
return jsonify([{"batch": result}])


Expand Down
Loading

0 comments on commit 2961057

Please sign in to comment.