Test change
Browse files
app.py
CHANGED
@@ -6,6 +6,9 @@ from dotenv import load_dotenv
|
|
6 |
from langchain_groq import ChatGroq
|
7 |
from langchain_core.output_parsers import StrOutputParser
|
8 |
from langchain_core.prompts import ChatPromptTemplate
|
|
|
|
|
|
|
9 |
load_dotenv()
|
10 |
client = Groq(api_key=os.getenv('GROQ_API_KEY'))
|
11 |
model = 'whisper-large-v3'
|
@@ -63,4 +66,8 @@ def answer(user_question):
|
|
63 |
answer = chain.invoke({'question': user_question})
|
64 |
return answer
|
65 |
|
66 |
-
|
|
|
|
|
|
|
|
|
|
6 |
from langchain_groq import ChatGroq
|
7 |
from langchain_core.output_parsers import StrOutputParser
|
8 |
from langchain_core.prompts import ChatPromptTemplate
|
9 |
+
from transformers import BarkModel, AutoProcessor, AutoModelForTextToWaveform, pipeline
|
10 |
+
import scipy
|
11 |
+
|
12 |
load_dotenv()
|
13 |
client = Groq(api_key=os.getenv('GROQ_API_KEY'))
|
14 |
model = 'whisper-large-v3'
|
|
|
66 |
answer = chain.invoke({'question': user_question})
|
67 |
return answer
|
68 |
|
69 |
+
synthesiser = pipeline("text-to-speech", "suno/bark")
|
70 |
+
|
71 |
+
speech = synthesiser("Hello, my dog is cooler than you!", forward_params={"do_sample": True})
|
72 |
+
|
73 |
+
scipy.io.wavfile.write("bark_out.wav", rate=speech["sampling_rate"], data=speech["audio"])
|