Steven-GU-Yu-Di commited on
Commit
477b035
·
verified ·
1 Parent(s): 30a2420

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -7
app.py CHANGED
@@ -1,15 +1,11 @@
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")
 
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")