forked from rai-project/mlmodelscope
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Completed Audio To Audio Modality (#25)
* Completed Audio To Audio Modality * Updated audioToAAudio icon * Minor formatting updates
- Loading branch information
1 parent
cc83cbc
commit b1cf1ba
Showing
12 changed files
with
187 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
32 changes: 32 additions & 0 deletions
32
src/components/Experiment/QuickOutput/Outputs/AudioToAudio/AudioToAudioOutput.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import React from "react"; | ||
import useBEMNaming from "../../../../../common/useBEMNaming"; | ||
import useTextOutput from "../Text/useTextOutput"; | ||
|
||
import { AudioOutputBox } from "../TextToAudio/AudioOutputBox"; | ||
import AudioToTextOutputInputSection from "../AudioToText/AudioToTextOutputInputSection"; | ||
|
||
|
||
import { audioToAudio } from "../../../../../helpers/TaskIDs"; | ||
export default function AudioToAudioOutput(props) { | ||
const { getBlock } = useBEMNaming("audio-to-audio-output"); | ||
|
||
// Note: This method could probably be renamed to a more generic 'useOutput' or similar? | ||
const { output, inferenceDuration, input, setInput } = useTextOutput( | ||
props.trial | ||
); | ||
|
||
const onSubmit = () => { | ||
props.onSubmit(input); | ||
}; | ||
|
||
return ( | ||
<div className={getBlock()}> | ||
<AudioToTextOutputInputSection | ||
input={input} | ||
setInput={setInput} | ||
onSubmit={onSubmit} | ||
/> | ||
<AudioOutputBox duration={inferenceDuration} output={output} task={audioToAudio} /> | ||
</div> | ||
); | ||
} |
13 changes: 13 additions & 0 deletions
13
src/components/Experiment/QuickOutput/Outputs/AudioToAudio/AudioToAudioOutput.stories.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import React from "react"; | ||
import AudioToAudioOutput from "./AudioToAudioOutput"; | ||
import { TestAudioToAudioOutput } from "./testData/testAudioToAudio"; | ||
|
||
export default { | ||
title: "Experiments/Quick Output/Audio to Audio", | ||
component: AudioToAudioOutput, | ||
}; | ||
|
||
const template = (args) => <AudioToAudioOutput {...args} />; | ||
|
||
export const Default = template.bind({}); | ||
Default.args = { trial: TestAudioToAudioOutput }; |
30 changes: 30 additions & 0 deletions
30
src/components/Experiment/QuickOutput/Outputs/AudioToAudio/testData/testAudioToAudio.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
export const TestAudioToAudioOutputGeneratedToken = { | ||
id: "sampleidhere" | ||
}; | ||
|
||
export const TestAudioToAudioOutput = { | ||
id: "sampletestaudiotoaudiooutputidhere", | ||
inputs: [ | ||
{ | ||
title: "audio1.flac", | ||
src: "https://xlab1.netlify.app/audio-to-audio-input.flac" | ||
}, | ||
], | ||
completed_at: "2023-06-03T18:17:14.513854Z", | ||
results: { | ||
'duration': "9.216154124s", | ||
'duration_for_inference': "9.193807904s", | ||
'responses': [ | ||
{ | ||
'features': [ | ||
{ | ||
title: "text-to-audio-output.flac", | ||
src: "https://xlab1.netlify.app/audio-to-audio-output.flac", | ||
type: 'AUDIO' | ||
} | ||
], | ||
'id': "sampletesttexttoaudiooutputresponseidhere" | ||
} | ||
] | ||
} | ||
} |
2 changes: 1 addition & 1 deletion
2
src/components/Experiment/QuickOutput/Outputs/AudioToText/AudioToText.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletions
1
src/components/Experiment/QuickOutput/Outputs/AudioToText/AudioToTextOutputInputSection.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.