-
Notifications
You must be signed in to change notification settings - Fork 324
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
108 additions
and
9 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,22 @@ | ||
import ell | ||
|
||
from pydub import AudioSegment | ||
import numpy as np | ||
|
||
# Helper function to load and convert audio files | ||
def load_audio_sample(file_path): | ||
audio = AudioSegment.from_file(file_path) | ||
samplearray = np.array(audio.get_array_of_samples()) | ||
return samplearray | ||
|
||
|
||
ell.init(verbose=True) | ||
|
||
@ell.complex("gpt-4o-audio-preview") | ||
def test(): | ||
return [ell.user("Hey! Could you talk to me in spanish? I'd like to hear how you say 'ell'.")] | ||
return [ell.user(["Hey! what do you think about this?", load_audio_sample("toronto.mp3")])] | ||
|
||
response = test() | ||
print(response.audios[0]) | ||
|
||
if __name__ == "__main__": | ||
test() | ||
|
||
response = test() | ||
print(response.audios[0]) |
Binary file not shown.
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