Skip to content

Commit

Permalink
Model activating enhancements (#764)
Browse files Browse the repository at this point in the history
* Added Enhancements to model activation

* removed usused track

* Added Space

* removed spaces

* added model condition
  • Loading branch information
1AhmedYasser authored Dec 30, 2024
1 parent 0ccf539 commit 47895f8
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 16 deletions.
33 changes: 20 additions & 13 deletions DSL/Ruuter.private/POST/rasa/intents/add-remove-from-model.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,15 +36,21 @@ assign_filename:
assign:
intentFile: ${fileLocations.response.body.response.intents_location + intent + "_nlu.yml"}
intentTmpFile: ${fileLocations.response.body.response.intents_location + intent + "_nlu.yml.tmp"}

rename_tmp_file:

check_if_intent_is_in_model:
switch:
- condition: ${inModel}
next: rename_back_to_tmp_file
next: getDomainFile

rename_back_to_tmp_file:
call: http.post
args:
url: "[#TRAINING_DMAPPER]/file-manager/move"
body:
file_path: "${intentTmpFile}"
new_path: "${intentFile}"
result: moved
file_path: "${intentFile}"
new_path: "${intentTmpFile}"
result: movedback

getDomainFile:
call: http.get
Expand All @@ -58,6 +64,15 @@ isInModel:
switch:
- condition: ${inModel}
next: removeFromDomainArray

rename_tmp_file:
call: http.post
args:
url: "[#TRAINING_DMAPPER]/file-manager/move"
body:
file_path: "${intentTmpFile}"
new_path: "${intentFile}"
result: moved
next: mergeIntents

removeFromDomainArray:
Expand Down Expand Up @@ -102,14 +117,6 @@ updateDomainOpenSearch:
input: ${domainYaml.response.body.json}
result: updateSearchResult

getFileLocations:
call: http.get
args:
url: "[#TRAINING_PUBLIC_RUUTER]/internal/return-file-locations"
headers:
cookie: ${incoming.headers.cookie}
result: fileLocations

saveDomainFile:
call: http.post
args:
Expand Down
8 changes: 7 additions & 1 deletion GUI/src/pages/ModelBankAndAnalytics/Models/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import withAuthorization, { ROLES } from 'hoc/with-authorization';

const Models: FC = () => {
const MODEL_FETCH_INTERVAL = 5000;
const MODEL_FETCH_TIMEOUT = 300000;
const MODEL_FETCH_TIMEOUT = 120000;

const { t } = useTranslation();
const toast = useToast();
Expand Down Expand Up @@ -100,6 +100,11 @@ const Models: FC = () => {
const timeoutId = setTimeout(() => {
clearInterval(intervalId);
setIsFetching(false);
toast.open({
type: 'error',
title: t('global.notificationError'),
message: t('toast.modelActivationTimedOut'),
});
}, MODEL_FETCH_TIMEOUT);

if (currentlyLoadedModel?.id === previouslyLoadedModel?.id) {
Expand Down Expand Up @@ -163,6 +168,7 @@ const Models: FC = () => {
{selectedModel.state !== 'DEPLOYED' && (
<Button
appearance="success"
disabled={isFetching}
onClick={() => setModelConfirmation(selectedModel.id)}
>
{isFetching &&
Expand Down
3 changes: 2 additions & 1 deletion GUI/translations/en/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,8 @@
"appealDeleted": "Appeal deleted",
"copied": "Copied to clipboard",
"modelDeleted": "Model deleted",
"modelActivated": "Model activated",
"modelActivated": "Model has been published",
"modelActivationTimedOut": "Model activation expired",
"testStoryDeleted": "Test story deleted",
"configurationSaved": "Configuration saved",
"newFormAdded": "New form added",
Expand Down
3 changes: 2 additions & 1 deletion GUI/translations/et/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,8 @@
"appealDeleted": "Apellatsioon kustutatud",
"copied": "Kopeeriti lõikelauale",
"modelDeleted": "Mudel kustutatud",
"modelActivated": "Mudel aktiveeritud",
"modelActivated": "Mudel on avalikustatud",
"modelActivationTimedOut": "Mudeli aktiveerimine aegus",
"testStoryDeleted": "Testlugu kustutatud",
"configurationSaved": "Seadistus salvestatud",
"newFormAdded": "Uus ankeet lisatud",
Expand Down

0 comments on commit 47895f8

Please sign in to comment.