Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,15 +1,11 @@
|
|
| 1 |
import streamlit as st
|
| 2 |
-
from transformers import pipeline
|
| 3 |
|
| 4 |
# 加载 Visual Question Answering 模型 microsoft/git-base-vqav2
|
| 5 |
vqa_pipeline = pipeline("text2text-generation", model="microsoft/git-base-vqav2")
|
| 6 |
|
| 7 |
-
#
|
| 8 |
-
text_to_speech_pipeline = pipeline(
|
| 9 |
-
"text-to-speech",
|
| 10 |
-
model="microsoft/speecht5_tts",
|
| 11 |
-
config=T5Config.from_pretrained("microsoft/speecht5_tts", speaker_embeddings=True)
|
| 12 |
-
)
|
| 13 |
|
| 14 |
def main():
|
| 15 |
st.title("Visual Question Answering with Text-to-Speech")
|
|
|
|
| 1 |
import streamlit as st
|
| 2 |
+
from transformers import pipeline
|
| 3 |
|
| 4 |
# 加载 Visual Question Answering 模型 microsoft/git-base-vqav2
|
| 5 |
vqa_pipeline = pipeline("text2text-generation", model="microsoft/git-base-vqav2")
|
| 6 |
|
| 7 |
+
# 加载文本到语音模型并指定 speaker_embeddings
|
| 8 |
+
text_to_speech_pipeline = pipeline("text-to-speech", model="microsoft/speecht5_tts", speaker_embeddings=True)
|
|
|
|
|
|
|
|
|
|
|
|
|
| 9 |
|
| 10 |
def main():
|
| 11 |
st.title("Visual Question Answering with Text-to-Speech")
|