itsmeagain4 commited on
Commit
b94cf7f
1 Parent(s): 005f615

first done

Browse files
Files changed (2) hide show
  1. gradio_cached_examples/13/log.csv +2 -0
  2. test.py +12 -0
gradio_cached_examples/13/log.csv ADDED
@@ -0,0 +1,2 @@
 
 
 
1
+ Output,flag,username,timestamp
2
+ "AutomaticSpeechRecognitionOutput(text=' Thank you.', chunks=None)",,,2024-08-19 03:30:41.699942
test.py ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from pathlib import Path
2
+ from openai import OpenAI
3
+ client = OpenAI()
4
+
5
+ speech_file_path = Path(__file__).parent / "speech.mp3"
6
+ response = client.audio.speech.create(
7
+ model="tts-1",
8
+ voice="alloy",
9
+ input="Today is a wonderful day to build something people love!"
10
+ )
11
+
12
+ response.stream_to_file(speech_file_path)