Skip to content

Commit

Permalink
Merge pull request #872 from stanford-oval/wip/mehrad/fixes
Browse files Browse the repository at this point in the history
Fix arguments after adding `-url`
  • Loading branch information
Mehrad0711 committed Feb 10, 2022
2 parents 715af77 + 3f2a2fd commit 7d119ae
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 9 deletions.
10 changes: 5 additions & 5 deletions tool/assistant.ts
Original file line number Diff line number Diff line change
Expand Up @@ -262,23 +262,23 @@ export function initArgparse(subparsers : argparse.SubParser) {
export async function execute(args : any) {
if (!args.thingpedia_url)
args.thingpedia_url = await getConfig('thingpedia.url', process.env.THINGPEDIA_URL || DEFAULT_THINGPEDIA_URL);
if (!args.nlu_server)
args.nlu_server = await getConfig('thingpedia.nlp-url', DEFAULT_NLP_URL);
if (!args.nlu_server_url)
args.nlu_server_url = await getConfig('thingpedia.nlp-url', DEFAULT_NLP_URL);

const platform = new Platform(args.workdir, args.locale, args.thingpedia_url);
const prefs = platform.getSharedPreferences();
if (args.thingpedia_dir && args.thingpedia_dir.length)
prefs.set('developer-dir', args.thingpedia_dir);
prefs.set('experimental-use-neural-nlg', !!args.nlg_server);
prefs.set('experimental-use-neural-nlg', !!args.nlg_server_url);
const engine = new Engine(platform);

const rl = readline.createInterface({ input: process.stdin, output: process.stdout });
rl.setPrompt('$ ');

await engine.open();
const conversation = await engine.assistant.getOrOpenConversation('main', {
nluServerUrl: args.nlu_server,
nlgServerUrl: args.nlg_server,
nluServerUrl: args.nlu_server_url,
nlgServerUrl: args.nlg_server_url,
debug: args.debug,
showWelcome: true
});
Expand Down
8 changes: 4 additions & 4 deletions tool/auto-annotate-multiwoz.ts
Original file line number Diff line number Diff line change
Expand Up @@ -233,8 +233,8 @@ interface ConverterOptions {
timezone : string;
thingpedia : string;
database_file : string;
user_nlu_server : string;
agent_nlu_server : string;
user_nlu_server_url : string;
agent_nlu_server_url : string;
only_multidomain : boolean;
use_existing : boolean;
max_turn : number|undefined;
Expand Down Expand Up @@ -283,8 +283,8 @@ class Converter extends stream.Readable {
this._onlyMultidomain = args.only_multidomain;
this._tpClient = new Tp.FileClient(args);
this._schemas = new SchemaRetriever(this._tpClient, null, true);
this._userParser = ParserClient.get(args.user_nlu_server, 'en-US');
this._agentParser = ParserClient.get(args.agent_nlu_server, 'en-US');
this._userParser = ParserClient.get(args.user_nlu_server_url, 'en-US');
this._agentParser = ParserClient.get(args.agent_nlu_server_url, 'en-US');
this._useExisting = args.use_existing;
this._maxTurn = args.max_turn;
this._timezone = args.timezone;
Expand Down
1 change: 1 addition & 0 deletions tool/requote.js
Original file line number Diff line number Diff line change
Expand Up @@ -516,6 +516,7 @@ export async function execute(args) {
console.error('**************');
console.error('Failed to requote');
console.error(String(e));
console.error(ex.id);
console.error(ex.preprocessed);
console.error(ex.target_code);
console.error('**************');
Expand Down

0 comments on commit 7d119ae

Please sign in to comment.