Skip to content

Commit

Permalink
Merge pull request #1116 from stanford-oval/wip/update-deps
Browse files Browse the repository at this point in the history
Small fixes
  • Loading branch information
nrser committed Oct 27, 2021
2 parents 381ea32 + 020ef08 commit 5da517f
Show file tree
Hide file tree
Showing 6 changed files with 43 additions and 25 deletions.
17 changes: 6 additions & 11 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,18 +20,19 @@ services:
before_install:
- sudo apt-get update && sudo apt-get install apt-transport-https ca-certificates -y && sudo update-ca-certificates

stages:
- test
- name: deploy
if: type = push AND branch = master AND repo = stanford-oval/almond-cloud

env:
global:
- TZ="America/Los_Angeles"
- COVERALLS_PARALLEL=true

jobs:
include:
-
name: "Docker Build"
if: type = push AND branch = master AND repo = stanford-oval/almond-cloud
install:
- docker login -u $DOCKER_USERNAME -p $DOCKER_PASSWORD
script: ./travis/docker-build.sh
-
name: "Unit Tests"
install:
Expand Down Expand Up @@ -95,12 +96,6 @@ jobs:
- export PATH="`pwd`/geckodriver:$PATH"
script: npx nyc ./tests/nlp-integration.sh
after_success: npm run coverage
-
stage: deploy
name: "Docker Build"
install:
- docker login -u $DOCKER_USERNAME -p $DOCKER_PASSWORD
script: ./travis/docker-build.sh

notifications:
webhooks: https://coveralls.io/webhook
Expand Down
12 changes: 2 additions & 10 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 9 additions & 3 deletions src/nlp/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,11 +87,17 @@ export class NLPInferenceServer {

async loadExactMatcher(matcher : Genie.ExactMatcher, language : string) {
const url = AbstractFS.resolve(Config.NL_EXACT_MATCH_DIR, language + '.btrie');
const tmpPath = await AbstractFS.download(url);

await matcher.load(tmpPath);
try {
const tmpPath = await AbstractFS.download(url);
await matcher.load(tmpPath);

await AbstractFS.removeTemporary(tmpPath);
await AbstractFS.removeTemporary(tmpPath);
} catch(e : any) {
if (e.code !== 'ENOENT' && e.code !== 404)
throw e;
console.log(`WARNING: missing exact matcher file for ${language}`);
}
}

async load() {
Expand Down
20 changes: 20 additions & 0 deletions src/nlp/voice/backend-microsoft.ts
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,26 @@ const VOICES : Record<string, { male : string; female : string }> = {
male: "GuyNeural",
female: "AriaNeural",
},
"it-it": {
male: "DiegoNeural",
female: "ElsaNeural"
},
"zh-cn": {
male: "YunxiNeural",
female: "XiaohanNeural"
},
"zh-tw": {
male: "YunJheNeural",
female: "HsiaoChenNeural"
},
"es-es": {
male: "AlvaroNeural",
female: "ElviraNeural"
},
"es-us": {
male: "AlonsoNeural",
female: "PalomaNeural"
}
};

/**
Expand Down
5 changes: 5 additions & 0 deletions tests/nlp-integration.sh
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,11 @@ ENABLE_PROMETHEUS: true
PROMETHEUS_ACCESS_TOKEN: my-prometheus-access-token
MS_SPEECH_SUBSCRIPTION_KEY: "${MS_SPEECH_SUBSCRIPTION_KEY}"
MS_SPEECH_SERVICE_REGION: westus2
SUPPORTED_LANGUAGES:
- en-US
- it-IT
- zh-CN
- es-ES
NL_MODELS:
- tag: org.thingpedia.models.default
locale: en
Expand Down
2 changes: 1 addition & 1 deletion tests/website/test_register.js
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ async function testRegister(charlie) {
}, charlie);

// check that now we're registered
await util.promisify(setTimeout)(30000);
await util.promisify(setTimeout)(45000);
const result = minidom.parse(await sessionRequest('/user/profile', 'GET', null, charlie));

let found = false;
Expand Down

0 comments on commit 5da517f

Please sign in to comment.