Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -26,7 +26,7 @@ def text_generation(text):
|
|
26 |
tokenizer = AutoTokenizer.from_pretrained("microsoft/Phi-3-mini-128k-instruct")
|
27 |
|
28 |
messages = [
|
29 |
-
{"role": "user", "content": text
|
30 |
]
|
31 |
|
32 |
generation_args = {
|
@@ -40,7 +40,7 @@ def text_generation(text):
|
|
40 |
response = text_gen(messages, **generation_args)
|
41 |
return response[0]["generated_text"]
|
42 |
|
43 |
-
|
44 |
text_to_audio = pipeline("text-to-speech", model="kakao-enterprise/vits-ljs")
|
45 |
narrated_text = text_to_audio(text)
|
46 |
return (narrated_text["sampling_rate"], narrated_text["audio"][0] )
|
|
|
26 |
tokenizer = AutoTokenizer.from_pretrained("microsoft/Phi-3-mini-128k-instruct")
|
27 |
|
28 |
messages = [
|
29 |
+
{"role": "user", "content": text}
|
30 |
]
|
31 |
|
32 |
generation_args = {
|
|
|
40 |
response = text_gen(messages, **generation_args)
|
41 |
return response[0]["generated_text"]
|
42 |
|
43 |
+
def text_to_speech(text):
|
44 |
text_to_audio = pipeline("text-to-speech", model="kakao-enterprise/vits-ljs")
|
45 |
narrated_text = text_to_audio(text)
|
46 |
return (narrated_text["sampling_rate"], narrated_text["audio"][0] )
|