Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
face2ea
[neural_image_generation] Started the development of imgen v2
serbinadrian Jul 20, 2023
e3bc13a
[neural_image_generation] Create imgenMeta.json
serbinadrian Jul 23, 2023
137ba31
[neural_image_generation] Edited type of remote json
serbinadrian Jul 23, 2023
c69b43f
[neural_image_generation] Edited type of remote json
serbinadrian Jul 24, 2023
4c866e3
[neural_image_genearion]
serbinadrian Jul 27, 2023
87bf960
Merge branch 'imgen' of https://github.com/serbinadrian/AI-sevices-UI…
serbinadrian Jul 27, 2023
4ac383e
[GENERATIVE_LANGUGE_MODELS] Added proto
serbinadrian Mar 15, 2024
06f29a0
[NEURAL_MUSIC_DEMIXING] Added proto
serbinadrian Mar 15, 2024
bf0ec3c
[GENERATIVE_LANGUAGE_MODESL] Added service UI
serbinadrian Mar 15, 2024
e5712ae
[NEURAL_MUSIC_DEMIXING] Added service
serbinadrian Mar 15, 2024
91d5bfd
Merge branch 'master' into imgen
serbinadrian Mar 15, 2024
4f52c90
Merge branch 'serbinadrian:master' into master
MarinaFedy Mar 18, 2024
fccab26
[hate_speech_detection_triton] hate speech service, new proto, reques…
Mar 18, 2024
fcdd427
Merge pull request #25 from MarinaFedy/master
serbinadrian Mar 18, 2024
3a1a442
[example_service] updated structure
serbinadrian Apr 17, 2024
0435c18
[exampl_service] Added 'multiple-call' service variant
serbinadrian Apr 18, 2024
cabf978
[example_service] completed multiple call template
serbinadrian Apr 19, 2024
c4423b7
[example_service] Added unary call service
serbinadrian Apr 19, 2024
2e3c76d
[example_service] Added templates for developers
serbinadrian Apr 19, 2024
5c92678
reorganized repository structure
serbinadrian May 1, 2024
0446126
[Rejuve_BayesNet] added
serbinadrian May 1, 2024
0b59884
repository cleanup
serbinadrian May 1, 2024
525c0e9
[tts] add new service
May 20, 2024
1bd503b
[tts] fixed labels text
May 21, 2024
8b8c766
[tts] updated tts: added slider and voice examples
May 27, 2024
06a9e47
Merge branch 'serbinadrian:master' into master
MarinaFedy Aug 5, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
548 changes: 548 additions & 0 deletions naint/TTS_service/index.js

Large diffs are not rendered by default.

62 changes: 62 additions & 0 deletions naint/TTS_service/inputParameters.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
export const VOICE_EXAMPLE_SRC = (voiceId) =>
`https://marketplace-dapp-data.s3.amazonaws.com/text_to_speech_speakers/${voiceId}_speaker.wav`;

export const VOICES = [
{ id: 19, gender: 'woman', tone: 'mid', age: 'old' },
{ id: 41, gender: 'woman', tone: 'mid', age: 'young' },
{ id: 57, gender: 'man', tone: 'mid', age: 'young' },
{ id: 60, gender: 'woman', tone: 'mid', age: 'old' },
{ id: 170, gender: 'woman', tone: 'mid', age: 'young' },
{ id: 174, gender: 'woman', tone: 'mid', age: 'young' },
{ id: 190, gender: 'man', tone: 'mid', age: 'old' },
{ id: 191, gender: 'man', tone: 'mid', age: 'old' },
{ id: 222, gender: 'woman', tone: 'mid', age: 'old' },
{ id: 246, gender: 'woman', tone: 'mid', age: 'young' },
{ id: 286, gender: 'woman', tone: 'high', age: 'young' },
];

export const DROPDOWN_PARAMETERS = {
emotion: {
1: {
label: 'Neutral',
value: '1',
},
2: {
label: 'Happy',
value: '2',
},
3: {
label: 'Sad',
value: '3',
},
4: {
label: 'Angry',
value: '4',
},
5: {
label: 'Fear',
value: '5',
},
6: {
label: 'Disgust',
value: '6',
},
7: {
label: 'Surprise',
value: '7',
},
},
gender: {
man: { label: 'Man', value: 'man' },
woman: { label: 'Woman', value: 'woman' },
},
age: {
young: { label: 'Young', value: 'young' },
old: { label: 'Old', value: 'old' },
},
tone: {
low: { label: 'Low', value: 'low' },
mid: { label: 'Mid', value: 'mid' },
high: { label: 'High', value: 'high' },
},
};
232 changes: 232 additions & 0 deletions naint/TTS_service/metadata.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,232 @@
export const MODEL = {
informationLinks: {
GIT_HUB: 'https://github.com/iktina/hate-speech-detection',
USER_GUIDE: 'https://github.com/iktina/hate-speech-detection',
ORIGINAL_PROJECT: 'https://github.com/iktina/hate-speech-detection',
},
state: {
response: undefined,
textInputValue: '',
emotionValue: '',
speakerSpeedValue: 0,
genderValue: '',
ageValue: '',
toneValue: '',
selectedVoice: '',
status: {
isAllRequirementsMet: false,
errors: new Map(),
},
},
restrictions: {
rangeRestrictions: {
ONLY_LATINS_TEXT_LENGTH: {
min: 1,
max: 300,
},
SPEAKER_SPEED_RESTRICTION: {
min: -1,
max: 1,
step: 0.2,
stateKey: 'speakerSpeed',
},
},
valueRestrictions: {
ONLY_LATINS_REGEX: {
value: `^[?!.,:;"'--()a-zA-Z\\s]+$`,
errorKey: 'ONLY_LATINS_REGEX_ERROR',
},
},
},
service: {
METHOD: 'tts',
},
};

export const BLOCKS = {
inputBlocks: {
TEXT_INPUT: {
type: 'text-area',
id: 'text-input',
name: 'textInputValue',
rows: 3,
edit: true,
stateKey: 'textInputValue',
handleFunctionKey: 'handleTextInput',
helperFunctionKey: 'inputMaxLengthHelperFunction',
rangeRestrictionKey: 'ONLY_LATINS_TEXT_LENGTH',
labelKey: 'TEXT_INPUT',
},
SPEAKER_SPEED_INPUT: {
type: 'slider',
id: 'speaker-speed-input',
name: 'speakerSpeedValue',
stateKey: 'speakerSpeedValue',
handleFunctionKey: 'handleSelectItem',
rangeRestrictionKey: 'SPEAKER_SPEED_RESTRICTION',
min: -1,
max: 1,
step: 0.1,
labelKey: 'SPEAKER_SPEED',
points: [-1, 0, 1],
},
EMOTION_INPUT: {
type: 'dropdown',
id: 'emotion-dropdown',
name: 'emotionValue',
stateKey: 'emotionValue',
optionsList: 'emotion',
handleFunctionKey: 'handleSelectItem',
labelKey: 'EMOTION_INPUT',
},
VOICE_FILTER_PARAMETERS: [
{
type: 'dropdown',
id: 'gender-dropdown',
name: 'genderValue',
stateKey: 'genderValue',
optionsList: 'gender',
handleFunctionKey: 'handleFilterDropdownSelect',
labelKey: 'GENDER_INPUT',
},
{
type: 'dropdown',
id: 'age-dropdown',
name: 'ageValue',
stateKey: 'ageValue',
optionsList: 'age',
handleFunctionKey: 'handleFilterDropdownSelect',
labelKey: 'AGE_INPUT',
},
{
type: 'dropdown',
id: 'tone-dropdown',
name: 'toneValue',
stateKey: 'toneValue',
optionsList: 'tone',
handleFunctionKey: 'handleFilterDropdownSelect',
labelKey: 'TONE_INPUT',
},
],
VOICE_FILTER: {
GENDER: 'gender',
TONE: 'tone',
AGE: 'age',
},
RADIO_BUTTON: {
name: 'selectedVoice',
stateKey: 'selectedVoice',
handleFunctionKey: 'handleSelectItem',
},
},
outputBlocks: {
SERVICE_OUTPUT: {
type: 'audio',
name: 'service-response',
stateKey: 'response',
labelKey: 'SERVICE_OUTPUT',
},
USER_TEXT_INPUT: {
type: 'text-area',
id: 'textInput',
name: 'textInput',
rows: 3,
edit: false,
stateKey: 'textInputValue',
labelKey: 'PROCESSED_TEXT',
isFullWidth: true,
},
USER_INPUTED_PREFERENCES: [
{
type: 'block',
id: 'gender',
name: 'gender',
stateKey: 'genderValue',
rows: 1,
edit: false,
labelKey: 'GENDER_INPUT',
isFullWidth: false,
},
{
type: 'block',
id: 'age',
name: 'age',
stateKey: 'ageValue',
rows: 1,
edit: false,
labelKey: 'AGE_INPUT',
isFullWidth: false,
},
{
type: 'block',
id: 'tone',
name: 'tone',
stateKey: 'toneValue',
rows: 1,
edit: false,
labelKey: 'TONE_INPUT',
isFullWidth: false,
},
{
type: 'block',
id: 'emotion',
name: 'emotion',
stateKey: 'emotionValue',
rows: 1,
edit: false,
labelKey: 'EMOTION_INPUT',
isFullWidth: false,
},
],
},
informationBlocks: {
CODE: {
labelKey: 'VIEW_CODE',
linkKey: 'GIT_HUB',
svgPath:
'M12.007 0C6.12 0 1.1 4.27.157 10.08c-.944 5.813 2.468 11.45 8.054 13.312.19.064.397.033.555-.084.16-.117.25-.304.244-.5v-2.042c-3.33.735-4.037-1.56-4.037-1.56-.22-.726-.694-1.35-1.334-1.756-1.096-.75.074-.735.074-.735.773.103 1.454.557 1.846 1.23.694 1.21 2.23 1.638 3.45.96.056-.61.327-1.178.766-1.605-2.67-.3-5.462-1.335-5.462-6.002-.02-1.193.42-2.35 1.23-3.226-.327-1.015-.27-2.116.166-3.09 0 0 1.006-.33 3.3 1.23 1.966-.538 4.04-.538 6.003 0 2.295-1.5 3.3-1.23 3.3-1.23.445 1.006.49 2.144.12 3.18.81.877 1.25 2.033 1.23 3.226 0 4.607-2.805 5.627-5.476 5.927.578.583.88 1.386.825 2.206v3.29c-.005.2.092.393.26.507.164.115.377.14.565.063 5.568-1.88 8.956-7.514 8.007-13.313C22.892 4.267 17.884.007 12.008 0z',
},
GUIDE: {
labelKey: 'USER_GUIDE',
linkKey: 'USER_GUIDE',
svgPath:
'M 12 2 C 6.48 2 2 6.48 2 12 s 4.48 10 10 10 s 10 -4.48 10 -10 S 17.52 2 12 2 Z m 1 15 h -2 v -6 h 2 v 6 Z m 0 -8 h -2 V 7 h 2 v 2 Z',
},
PROJECT: {
labelKey: 'ORIGINAL_PROJECT',
linkKey: 'ORIGINAL_PROJECT',
svgPath:
'M12 0c-6.627 0-12 5.373-12 12s5.373 12 12 12 12-5.373 12-12-5.373-12-12-12zm0 11.701c0 2.857-1.869 4.779-4.5 5.299l-.498-1.063c1.219-.459 2.001-1.822 2.001-2.929h-2.003v-5.008h5v3.701zm6 0c0 2.857-1.869 4.779-4.5 5.299l-.498-1.063c1.219-.459 2.001-1.822 2.001-2.929h-2.003v-5.008h5v3.701z',
},
},
};

const { rangeRestrictions } = MODEL.restrictions;
export const LABELS = {
labels: {
CHARS: 'characters',
TEXT_INPUT: 'Text to process:',
PROCESSED_TEXT: 'Processed text:',
SERVICE_OUTPUT: 'Result:',
VIEW_CODE: 'View code on Github',
USER_GUIDE: "User's guide",
ORIGINAL_PROJECT: 'View original project',
INVOKE_BUTTON: 'Invoke',
FILTER_HEADER:
'Please select the appropriate options to get filtered results',
EMOTION_INPUT: 'Emotion',
GENDER_INPUT: 'Gender',
AGE_INPUT: 'Age',
TONE_INPUT: 'Tone',
VOICE: 'Voice',
DISPLAYED: 'Displayed',
ROWS_OF: 'rows of',
SPEAKER_SPEED: 'Speed of the audio',
},
status: {
NO_RESPONSE: 'Something went wrong...',
},
errors: {
ONLY_LATINS_REGEX_ERROR: `The input text must be written in English only! No more than ${rangeRestrictions.ONLY_LATINS_TEXT_LENGTH.max} characters`,
},
};
65 changes: 65 additions & 0 deletions naint/TTS_service/styles.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
export const useStyles = (theme) => ({
invokeButton: {
textAlign: 'center',
'& button': {
margin: '0 !important',
},
},
alertMessage: {
width: '100%',
},
alertsContainer: {
display: 'block',
'& p': {
textAlign: 'center !important',
},
},
outputResultHeader: {
fontWeight: 600,
},
inputVoiceHeader: {
textAlign: 'center',
color: '#454545',
width: '100%',
},
sliderComponentContainer: {
marginTop: 20,
},
sliderContainer: {
padding: '30px',
marginTop: 10,
maxWidth: '100%',
alignItems: 'center',
display: 'flex',
'& .MuiSlider-root': { color: theme.palette.text.primary },
},
inputLineContainer: {
width: '100%',
display: 'flex',
justifyContent: 'space-between',
alignItems: 'center',
gap: 30,
padding: '10px 0',
margin: '0 0 10px 0',
},
inputLine: {
display: 'flex',
justifyContent: 'space-between',
cursor: 'pointer',
},
radioButton: {
color: `${theme.backgroundColor.blue} !important`,
},
responseCategory: {
fontWeight: 'bold',
},
outlinedBox: {
border: `1px solid ${theme.backgroundColor.blue}`,
padding: 10,
borderRadius: '5px',
},
audio: {
width: '100%',
height: 50,
},
});
Loading