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