Spaces:
Runtime error
Runtime error
lhzstar
commited on
Commit
·
fb6ade2
1
Parent(s):
56e0560
new commits
Browse files
app.py
CHANGED
@@ -18,7 +18,7 @@ def main():
|
|
18 |
if "messages" not in st.session_state:
|
19 |
st.session_state["messages"] = []
|
20 |
if "QA_model_path" not in st.session_state:
|
21 |
-
st.session_state["QA_model_path"] = "google/flan-t5-
|
22 |
if "sentTr_model_path" not in st.session_state:
|
23 |
st.session_state["sentTr_model_path"] = "sentence-transformers/all-mpnet-base-v2"
|
24 |
if "start_chat" not in st.session_state:
|
@@ -27,6 +27,8 @@ def main():
|
|
27 |
st.session_state["prompt_from_audio"] = ""
|
28 |
if "prompt_from_text" not in st.session_state:
|
29 |
st.session_state["prompt_from_text"] = ""
|
|
|
|
|
30 |
|
31 |
def text_submit():
|
32 |
st.session_state["prompt_from_text"] = st.session_state.widget
|
@@ -78,7 +80,7 @@ def main():
|
|
78 |
b64 = st.session_state["celeb_bot"].text_to_speech(autoplay=False)
|
79 |
md = f"""
|
80 |
<p>{response}</p>
|
81 |
-
<audio controls autoplay>
|
82 |
<source src="data:audio/wav;base64,{b64}" type="audio/wav">
|
83 |
Your browser does not support the audio element.
|
84 |
</audio>
|
|
|
18 |
if "messages" not in st.session_state:
|
19 |
st.session_state["messages"] = []
|
20 |
if "QA_model_path" not in st.session_state:
|
21 |
+
st.session_state["QA_model_path"] = "google/flan-t5-xl"
|
22 |
if "sentTr_model_path" not in st.session_state:
|
23 |
st.session_state["sentTr_model_path"] = "sentence-transformers/all-mpnet-base-v2"
|
24 |
if "start_chat" not in st.session_state:
|
|
|
27 |
st.session_state["prompt_from_audio"] = ""
|
28 |
if "prompt_from_text" not in st.session_state:
|
29 |
st.session_state["prompt_from_text"] = ""
|
30 |
+
if "celeb_bot" not in st.session_state:
|
31 |
+
st.session_state["celeb_bot"] = None
|
32 |
|
33 |
def text_submit():
|
34 |
st.session_state["prompt_from_text"] = st.session_state.widget
|
|
|
80 |
b64 = st.session_state["celeb_bot"].text_to_speech(autoplay=False)
|
81 |
md = f"""
|
82 |
<p>{response}</p>
|
83 |
+
<audio controls controlsList="autoplay nodownload">
|
84 |
<source src="data:audio/wav;base64,{b64}" type="audio/wav">
|
85 |
Your browser does not support the audio element.
|
86 |
</audio>
|