Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] Feat/dff/voice skill Oleg #565

Closed
wants to merge 117 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
117 commits
Select commit Hold shift + click to select a range
b2165ae
moving files from a broken fork
moon-strider Mar 6, 2023
c1c4475
adding tg token
moon-strider Mar 6, 2023
cee1799
changing the name of an attribute to be in line with dp-agent
moon-strider Mar 6, 2023
c38b48f
an attempt to fix []'s and a fix in rule based skill selector
moon-strider Mar 6, 2023
fcc96b5
fixing attributes
moon-strider Mar 7, 2023
07ee140
fixing validation
moon-strider Mar 7, 2023
4da797f
small actor.py fix
moon-strider Mar 7, 2023
9e3ef20
testing
moon-strider Mar 7, 2023
267960a
removing redundant string operations
moon-strider Mar 7, 2023
dd4b400
a minor fix that should enable .oga -> .wav
moon-strider Mar 7, 2023
96206b4
using subprocess ffmpeg to convert audio
moon-strider Mar 7, 2023
fcd21cb
adding missing files
moon-strider Mar 7, 2023
b4dc99f
a facepalm fix
moon-strider Mar 7, 2023
10994b0
another facepalm fix
moon-strider Mar 7, 2023
97cc9a2
keyerror fix
moon-strider Mar 7, 2023
2121a6d
model path fix
moon-strider Mar 7, 2023
4a28d84
minor refactor
moon-strider Mar 7, 2023
6916619
adding support for mp3 and MP3
moon-strider Mar 13, 2023
661b8ba
dcase-2020 -> dcase-2022
moon-strider Mar 20, 2023
5336db7
adding experiments.zip to project
moon-strider Mar 20, 2023
c40fc6a
apt install gdown to download model files
moon-strider Mar 20, 2023
98db32e
pip install gdown to download model files
moon-strider Mar 20, 2023
bd527b8
correct download links from gdrive
moon-strider Mar 20, 2023
17e74e5
gdown -> wget
moon-strider Mar 20, 2023
3415087
gdown -> wget 2
moon-strider Mar 20, 2023
069ecac
fixing dockerfile
moon-strider Mar 20, 2023
d8fa780
another dockerfile fix
moon-strider Mar 20, 2023
ccd9540
adding fire to reqs
moon-strider Mar 20, 2023
183798c
fixing new audio-captioning
moon-strider Mar 21, 2023
c77db08
mkdir -> makedirs
moon-strider Mar 21, 2023
5b243a4
small error fix
moon-strider Mar 21, 2023
a031c09
debugging commit 1
moon-strider Mar 21, 2023
5739d25
debugging commit 2
moon-strider Mar 21, 2023
95dae98
debugging commit 3
moon-strider Mar 21, 2023
85f33c0
debugging commit 4
moon-strider Mar 21, 2023
5a1c1d9
debugging commit 5
moon-strider Mar 21, 2023
27114fd
debugging commit 6
moon-strider Mar 21, 2023
6d6a82c
debugging commit 7
moon-strider Mar 21, 2023
e5252e8
debugging commit 8
moon-strider Mar 21, 2023
20935cc
debugging commit 9
moon-strider Mar 21, 2023
6c626fe
first working demo commit
moon-strider Mar 21, 2023
00d9ff5
added flac and ogg formats, minor refactoring
moon-strider Mar 28, 2023
ca198fc
purging audio files dir before inference
moon-strider Mar 29, 2023
6964343
minor fix
moon-strider Mar 29, 2023
7adbc38
adding video notes support
moon-strider Mar 30, 2023
7f476c5
removed hardcoded tg_token
moon-strider Jul 10, 2023
b63bba1
Models table upd (#539)
nstsj Aug 6, 2023
244b85f
fix: anthropic model params (#547)
dilyararimovna Aug 7, 2023
31305ae
fix summarization annotator card (#549)
mtalimanchuk Aug 8, 2023
2733f4a
Feat/complex tasks (#533)
Kpetyxova Aug 8, 2023
f99a312
Feat/prompted robot (#550)
smilni Aug 9, 2023
ca4ce85
fix: ranking and intent based response selector (#552)
dilyararimovna Aug 10, 2023
4f47d73
fix ru response selector component cards (#553)
mtalimanchuk Aug 12, 2023
7846b28
Feat/refactor dummy skill (#530)
smilni Aug 13, 2023
8b8fe4b
Feat/add external integration skill (#504)
smilni Aug 15, 2023
e015241
Fix/llms output postprocessing (#556)
dilyararimovna Aug 16, 2023
bbf0f3c
update property extraction (#482)
zucchini-nlp Aug 22, 2023
e8ff34a
Feat/ocean (#559)
moon-strider Aug 24, 2023
4c373e5
[WIP] Feat/mint (#505)
moon-strider Aug 25, 2023
e9eebff
Fix/midas cls (#560)
dilyararimovna Aug 28, 2023
f332432
user knowledge graph annotator (#360)
Ramimashkouk Aug 29, 2023
efda3cc
KG skills (#361)
Ramimashkouk Aug 31, 2023
2e35f1a
model, service and docker files upgraded
Aug 31, 2023
751887c
captioning model fixed
Aug 31, 2023
647347c
Fromage (#562)
oserikov Sep 4, 2023
7bd2873
image captioning restored
Sep 4, 2023
f76eafc
Dist n2 for ac (#569)
nstsj Sep 18, 2023
f6a0ff3
Fix/use gen configs in chatcompletion (#573)
dilyararimovna Sep 28, 2023
da2db2e
fix: werkzeug error (#574)
IgnatovFedor Oct 2, 2023
1383c47
agent commit changed, image_captioning temporary excluded
Oct 5, 2023
f589120
Ru mtl (#566)
dimakarp1996 Oct 10, 2023
3d67370
Refactoring skills display name (#578)
RafilGalimzyanov Oct 11, 2023
6d6d5a7
fixing path to chatgpt skill configurations (#580)
RafilGalimzyanov Oct 17, 2023
dd0fdba
updates to dream_kg distribution (#581)
annakorz Oct 24, 2023
712e405
Feat/pytest tests (#548)
NeoIsALie Oct 24, 2023
70012e4
Modify davinci config so it works better in russian (#587)
RafilGalimzyanov Nov 7, 2023
73f9355
Old agent
Nov 7, 2023
3a4eb91
fix: response selectors tags (#588)
dilyararimovna Nov 7, 2023
c04af70
feat: dream russian persona based (#590)
dilyararimovna Nov 11, 2023
f469e28
update property extraction (#576)
zucchini-nlp Nov 13, 2023
cca5c60
update OpenAI version to 1.2.3 (#592)
RafilGalimzyanov Nov 13, 2023
1779f34
Fixed all but pipeline_conf.json
Nov 14, 2023
0901f8f
pipeline_conf.json fixed according to dev
Nov 14, 2023
79f4aec
actor.py fixed according to dev
Nov 14, 2023
33373d5
Frommage removed
Nov 15, 2023
15a4832
dream_voice distributive created
Nov 15, 2023
6411a9f
dream_voice distributive restored
Nov 15, 2023
08969a8
dream_multimodal updated to dev
Nov 15, 2023
8e41fdd
dream_multimodal updated to dev 2.0
Nov 15, 2023
7ff61d0
dream_multimodal updated to dev 3.0
Nov 15, 2023
2b7a16b
dream_multimodal updated to dev 4.0
Nov 15, 2023
e12986e
Dream emotion dist (#568)
asleepann Nov 16, 2023
c1a1c19
formatters fix in progress
Nov 17, 2023
238111f
Feat/update openai (#593)
dilyararimovna Nov 18, 2023
70dc79b
dp_formatters updates
Nov 20, 2023
1103c99
dev merged into feat/dff/voice_skill
moon-strider Nov 21, 2023
87ce69b
codestyle fixed, skill messages changed
moon-strider Nov 21, 2023
6edd093
badlisted words removed from dream_voice
moon-strider Nov 21, 2023
471b14c
pr fix
moon-strider Nov 21, 2023
3973c8d
added tests to voice skill
moon-strider Nov 22, 2023
14d500b
voice_service fixed, tests added
moon-strider Nov 23, 2023
504b6f5
another pr fix
moon-strider Nov 23, 2023
6dfd095
pr fix
moon-strider Nov 24, 2023
da99b67
voice formatter fixed
moon-strider Nov 24, 2023
782552c
another pr fix
moon-strider Nov 29, 2023
5162457
captions -> caption, small pr fix
moon-strider Dec 1, 2023
c846c93
codestyle fix
moon-strider Dec 1, 2023
4820e98
flake8 fix
moon-strider Dec 1, 2023
1949265
typo fixed
moon-strider Dec 1, 2023
b5e51f7
codestyle fix
moon-strider Dec 1, 2023
04507ec
tests fixed for voice skill
moon-strider Dec 1, 2023
3accef7
another typo fixed
moon-strider Dec 1, 2023
cdd2be5
reverted voice_service dockerfile
moon-strider Dec 1, 2023
8418981
minor pr fix
moon-strider Dec 5, 2023
7577a55
voice service video fix
moon-strider Dec 6, 2023
efc670f
voice service video fix 2
moon-strider Dec 6, 2023
ab505df
git repo commit hardcoded
moon-strider Dec 6, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
36 changes: 16 additions & 20 deletions MODELS.md

Large diffs are not rendered by default.

14 changes: 14 additions & 0 deletions annotators/IntentCatcherTransformers/intent_phrases_commands.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,19 @@
{
"intent_phrases": {
"test_command": {
"phrases": [
"test_command",
"test command"
],
"reg_phrases": [
"test_command",
"test command"
],
"min_precision": 0.94,
"punctuation": [
"."
]
},
"track_object": {
"phrases": [
"((track)|(follow)|(trail)|(trace)|(find)|(rail)|(groove)|(monitor)) a ((human)|(man)|(car)|(bicycle)|(girl)|(dude)|(bag)|(chair)|(black dog)|(white cat))",
Expand Down
2 changes: 1 addition & 1 deletion annotators/IntentCatcherTransformers/test.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#!/bin/bash

python test.py
python tests/test.py
46 changes: 46 additions & 0 deletions annotators/IntentCatcherTransformers/tests/conftest.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
import json

import pytest

from os import getenv

INTENT_PHRASES_PATH = getenv("INTENT_PHRASES_PATH")


def pytest_addoption(parser):
parser.addoption("--uri", action="store", default="http://0.0.0.0")
parser.addoption("--port", action="store", default="8014")
parser.addoption("--handle", action="store", default="detect")


@pytest.fixture
def uri(request) -> str:
return request.config.getoption("--uri")


@pytest.fixture
def port(request) -> str:
return request.config.getoption("--port")


@pytest.fixture
def handle(request) -> str:
return request.config.getoption("--handle")


@pytest.fixture
def url(uri, port, handle) -> str:
return f"{uri}:{port}/{handle}"


@pytest.fixture
def tests():
if "RU" in INTENT_PHRASES_PATH and "commands" in INTENT_PHRASES_PATH:
tests = json.load(open("tests_commands_RU.json"))
elif "RU" in INTENT_PHRASES_PATH:
tests = json.load(open("tests_RU.json"))
elif "commands" in INTENT_PHRASES_PATH:
tests = json.load(open("tests_commands.json"))
else:
tests = json.load(open("tests.json"))
return tests
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,9 @@

import requests
import json
from os import getenv

INTENT_PHRASES_PATH = getenv("INTENT_PHRASES_PATH")
SERVICE_PORT = getenv("SERVICE_PORT")


def main_test():
url = f"http://0.0.0.0:{SERVICE_PORT}/detect"
if "RU" in INTENT_PHRASES_PATH and "commands" in INTENT_PHRASES_PATH:
tests = json.load(open("tests_commands_RU.json"))
elif "RU" in INTENT_PHRASES_PATH:
tests = json.load(open("tests_RU.json"))
elif "commands" in INTENT_PHRASES_PATH:
tests = json.load(open("tests_commands.json"))
else:
tests = json.load(open("tests.json"))

def test_intent_catcher(url: str, tests: dict):
for test in tests:
r = requests.post(url=url, json={"sentences": [[test["sentence"]]]})
assert r.ok
Expand All @@ -30,8 +16,3 @@ def main_test():
), print(f"TEST FAILED!\nTest: {test}\nResult:{json.dumps(data, indent=2)}")
else:
assert all([intent["detected"] == 0 for intent in data.values()]), f"test: {test}\nprediction: {data}"
print("Success")


if __name__ == "__main__":
main_test()
2 changes: 1 addition & 1 deletion annotators/IntentCatcherTransformers/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from itertools import chain
from typing import List

from common.universal_templates import join_sentences_in_or_pattern
from common.join_pattern import join_sentences_in_or_pattern


def get_regexp(intent_phrases_path):
Expand Down
27 changes: 27 additions & 0 deletions annotators/NER/tests/conftest.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import pytest


def pytest_addoption(parser):
parser.addoption("--uri", action="store", default="http://proxy.deeppavlov.ai")
parser.addoption("--port", action="store", default=8021)
parser.addoption("--handle", action="store", default="/ner")


@pytest.fixture
def uri(request) -> str:
return request.config.getoption("--uri")


@pytest.fixture
def port(request) -> int:
return request.config.getoption("--port")


@pytest.fixture
def handle(request) -> str:
return request.config.getoption("--handle")


@pytest.fixture
def url(uri, port, handle) -> str:
return f"{uri}:{port}/{handle}"
41 changes: 41 additions & 0 deletions annotators/NER/tests/test_ner.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
import json

import pytest

import sys
from os import path

import requests

PARENT_DIR = path.dirname(path.dirname(path.abspath(__file__)))
sys.path.append(PARENT_DIR)


@pytest.mark.parametrize(
"sentences, gold_result",
[
(
{
"last_utterances": [
["john peterson is my brother.", "he lives in New York."],
["my laptop was broken.", "could you show me the nearest store in Moscow where i can fix it."],
]
},
[
[
[{"confidence": 1, "end_pos": 2, "start_pos": 0, "text": "john peterson", "type": "PER"}],
[{"confidence": 1, "end_pos": 5, "start_pos": 3, "text": "New York", "type": "LOC"}],
],
[
[],
[{"confidence": 1, "end_pos": 9, "start_pos": 8, "text": "Moscow", "type": "LOC"}],
],
],
)
],
)
def test_ner(url: str, sentences: dict, gold_result: list):
response = requests.post(url, json=sentences, headers={"Content-Type": "application/json"})
result = json.loads(response.text)
assert response.status_code == 200
assert result == gold_result
20 changes: 20 additions & 0 deletions annotators/NER_deeppavlov/Dockerfile-test
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
FROM deeppavlov/deeppavlov:1.2.0-gpu

ARG CONFIG
ARG SERVICE_PORT
ARG SRC_DIR
ARG SED_ARG=" | "

ENV CONFIG=$CONFIG
ENV SERVICE_PORT=$SERVICE_PORT

COPY ./annotators/NER_deeppavlov/tests/requirements.txt /src/requirements.txt

RUN pip install --upgrade pip && \
pip install -r /src/requirements.txt

COPY $SRC_DIR /src

WORKDIR /src

CMD gunicorn --workers=1 --timeout 800 server:app -b 0.0.0.0:8021
2 changes: 1 addition & 1 deletion annotators/NER_deeppavlov/test.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash


python test_server.py
python -m pytest tests/test_server.py
52 changes: 0 additions & 52 deletions annotators/NER_deeppavlov/test_server.py

This file was deleted.

27 changes: 27 additions & 0 deletions annotators/NER_deeppavlov/tests/conftest.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import pytest


def pytest_addoption(parser):
parser.addoption("--uri", action="store", default="http://0.0.0.0")
parser.addoption("--port", action="store", default=8021)
parser.addoption("--handle", action="store", default="/ner")


@pytest.fixture
def uri(request) -> str:
return request.config.getoption("--uri")


@pytest.fixture
def port(request) -> int:
return request.config.getoption("--port")


@pytest.fixture
def handle(request) -> str:
return request.config.getoption("--handle")


@pytest.fixture
def url(uri, port, handle) -> str:
return f"{uri}:{port}/{handle}"
11 changes: 11 additions & 0 deletions annotators/NER_deeppavlov/tests/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
sentry-sdk[flask]==0.14.1
flask==1.1.1
gunicorn==19.9.0
itsdangerous==2.0.1
jinja2<=3.0.3
Werkzeug<=2.0.3
transformers==4.6.0
datasets==1.11.0
huggingface-hub==0.0.8
pytest==7.4.2
allure-pytest==2.13.2
56 changes: 56 additions & 0 deletions annotators/NER_deeppavlov/tests/test_server.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
import allure
import pytest
import requests


@allure.description("""Test NER""")
@pytest.mark.parametrize(
"request_data, gold_results",
[
(
{
"last_utterances": [
["я видела ивана в москве"],
["Я видела Ивана в Москве"],
["i have heard about justin. he is in sahara desert"],
["I have heard about Justin. He is in Sahara Desert"],
[
"can john smith move forward for 15 meters, then for \
fifteen meters, and get back to las vegas then"
],
["я бы проехала на 30 метров вперед, а потом повернула на сорок пять градусов по часовой стрелке"],
[""],
]
},
[
[[]],
[[]],
[
[
{"start_pos": 4, "end_pos": 5, "type": "PER", "text": "justin", "confidence": 1},
{"start_pos": 9, "end_pos": 11, "type": "LOC", "text": "sahara desert", "confidence": 1},
]
],
[
[
{"start_pos": 4, "end_pos": 5, "type": "PER", "text": "Justin", "confidence": 1},
{"start_pos": 9, "end_pos": 11, "type": "LOC", "text": "Sahara Desert", "confidence": 1},
]
],
[
[
{"start_pos": 1, "end_pos": 3, "type": "PER", "text": "john smith", "confidence": 1},
{"start_pos": 6, "end_pos": 8, "type": "QUANTITY", "text": "15 meters", "confidence": 1},
{"start_pos": 11, "end_pos": 13, "type": "QUANTITY", "text": "fifteen meters", "confidence": 1},
{"start_pos": 18, "end_pos": 20, "type": "LOC", "text": "las vegas", "confidence": 1},
]
],
[[]],
[[]],
],
)
],
)
def test_ner(url: str, request_data: dict, gold_results: list):
result = requests.post(url, json=request_data).json()
assert result == gold_results
28 changes: 28 additions & 0 deletions annotators/SentSeg/Dockerfile-test
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
FROM python:3.7-slim

ARG DATA_URL=files.deeppavlov.ai/alexaprize_data/sentseg/elmo2.tar.gz
ARG MODEL_META_URL=files.deeppavlov.ai/alexaprize_data/sentseg/model.meta
ARG MODEL_DATA_URL=files.deeppavlov.ai/alexaprize_data/sentseg/model.data-00000-of-00001

WORKDIR /src
RUN mkdir /data /elmo2 tfhub_cache_dir

RUN apt-get update && \
apt-get install -y curl && \
curl -L $DATA_URL --output /tmp/elmo2.tar.gz && \
tar -xf /tmp/elmo2.tar.gz -C /elmo2 && \
rm /tmp/elmo2.tar.gz && \
curl -L $MODEL_META_URL --output /data/model.meta && \
curl -L $MODEL_DATA_URL --output /data/model.data-00000-of-00001

ENV TFHUB_CACHE_DIR tfhub_cache_dir

COPY tests/requirements.txt .
RUN pip install --upgrade pip && \
pip install -r requirements.txt && \
python -c "import nltk; nltk.download('punkt')"

COPY . .
COPY model.index /data/

CMD gunicorn --workers=1 server:app