Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -1,11 +1,15 @@
|
|
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 |
|
10 |
def main():
|
11 |
st.title("Visual Question Answering with Text-to-Speech")
|
|
|
1 |
import streamlit as st
|
2 |
+
from transformers import pipeline, T5Config
|
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")
|