Skip to content

Commit

Permalink
model tags can be undefined (#107)
Browse files Browse the repository at this point in the history
following #87
  • Loading branch information
Pierrci authored Jun 14, 2021
1 parent 6c1c071 commit 998564c
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions interfaces/Libraries.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ predictor_input = {"passage": "My name is Wolfgang and I live in Berlin", "quest
predictions = predictor.predict_json(predictor_input)`;

const allennlp = (model: ModelData) => {
if (model.tags.includes("question-answering")){
if (model.tags?.includes("question-answering")){
return allennlpQuestionAnswering(model);
}
return allennlpUnknown();
Expand Down Expand Up @@ -100,9 +100,9 @@ const espnetUnknown = () =>
`unknown model type (must be text-to-speech or automatic-speech-recognition)`;

const espnet = (model: ModelData) => {
if (model.tags.includes("text-to-speech")){
if (model.tags?.includes("text-to-speech")){
return espnetTTS(model);
} else if (model.tags.includes("automatic-speech-recognition")) {
} else if (model.tags?.includes("automatic-speech-recognition")) {
return espnetASR(model);
}
return espnetUnknown();
Expand Down Expand Up @@ -147,9 +147,9 @@ model = TFAutoModel.from_pretrained("${model.modelId}")
`;

const tensorflowtts = (model: ModelData) => {
if (model.tags.includes("text-to-mel")){
if (model.tags?.includes("text-to-mel")){
return tensorflowttsTextToMel(model);
} else if (model.tags.includes("mel-to-wav")) {
} else if (model.tags?.includes("mel-to-wav")) {
return tensorflowttsMelToWav(model);
}
return tensorflowttsUnknown(model);
Expand Down

0 comments on commit 998564c

Please sign in to comment.