Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -2,10 +2,12 @@ import whisper
|
|
2 |
from langchain.chat_models import ChatOpenAI
|
3 |
from langchain.prompts import PromptTemplate
|
4 |
from langchain.chains import LLMChain
|
5 |
-
|
6 |
|
7 |
# Step 1: Load the Whisper model
|
8 |
-
model = whisper.load_model("base")
|
|
|
|
|
9 |
|
10 |
# Step 2: Function to convert speech to text
|
11 |
def speech_to_text(audio_file_path):
|
|
|
2 |
from langchain.chat_models import ChatOpenAI
|
3 |
from langchain.prompts import PromptTemplate
|
4 |
from langchain.chains import LLMChain
|
5 |
+
from transformers import AutoProcessor, AutoModelForSpeechSeq2Seq
|
6 |
|
7 |
# Step 1: Load the Whisper model
|
8 |
+
#model = whisper.load_model("base")
|
9 |
+
processor = AutoProcessor.from_pretrained("openai/whisper-base")
|
10 |
+
model = AutoModelForSpeechSeq2Seq.from_pretrained("openai/whisper-base")
|
11 |
|
12 |
# Step 2: Function to convert speech to text
|
13 |
def speech_to_text(audio_file_path):
|