import gradio as gr import openai def summarize_audio(audio_file): transcript = transcribe_audio(audio_file) summary = create_summary(transcript) return summary def transcribe_audio(audio_file): return "תמלול לדוגמה" def create_summary(transcript): response = openai.Completion.create( engine="text-davinci-003", prompt=f"Please summarize the following text:\n\n{transcript}", max_tokens=100 ) return response['choices'][0]['text'].strip() interface = gr.Interface( fn=summarize_audio, inputs=gr.Audio(source="upload", type="file"), outputs="text", title="ממיר אודיו לסיכום" ) if __name__ == "__main__": interface.launch()