Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -2,7 +2,7 @@ from transformers import pipeline
|
|
2 |
from langchain.vectorstores import FAISS
|
3 |
from langchain.embeddings import HuggingFaceEmbeddings
|
4 |
|
5 |
-
pipe = pipeline("automatic-speech-recognition", model="openai/whisper-
|
6 |
import json
|
7 |
with open("tasks.json", "r",encoding="utf-8") as json_file:
|
8 |
global data
|
@@ -24,7 +24,7 @@ for x,item in data.items():
|
|
24 |
|
25 |
|
26 |
def transcribe_the_command(audio_path,state):
|
27 |
-
transcript = pipe(audio_path)["text"]
|
28 |
similar = globals()[f"faiss_{state}"].similarity_search(transcript)[0].page_content
|
29 |
print(similar)
|
30 |
reply = find_index(similar)
|
|
|
2 |
from langchain.vectorstores import FAISS
|
3 |
from langchain.embeddings import HuggingFaceEmbeddings
|
4 |
|
5 |
+
pipe = pipeline("automatic-speech-recognition", model="openai/whisper-small")
|
6 |
import json
|
7 |
with open("tasks.json", "r",encoding="utf-8") as json_file:
|
8 |
global data
|
|
|
24 |
|
25 |
|
26 |
def transcribe_the_command(audio_path,state):
|
27 |
+
transcript = pipe(audio_path[1])["text"]
|
28 |
similar = globals()[f"faiss_{state}"].similarity_search(transcript)[0].page_content
|
29 |
print(similar)
|
30 |
reply = find_index(similar)
|