Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -71,12 +71,14 @@ def generate(audio_text, history, temperature=None, max_new_tokens=512, top_p=0.
|
|
71 |
response_tokens = []
|
72 |
total_tokens = 0
|
73 |
|
|
|
|
|
74 |
for response_token in stream:
|
75 |
total_tokens += len(response_token.token.text)
|
76 |
response_tokens.append(response_token.token.text)
|
77 |
response = ' '.join(response_tokens).replace('</s>', '')
|
78 |
progress = total_tokens / max_new_tokens
|
79 |
-
|
80 |
|
81 |
audio_file = text_to_speech(response)
|
82 |
return response, audio_file
|
|
|
71 |
response_tokens = []
|
72 |
total_tokens = 0
|
73 |
|
74 |
+
progress_bar = st.progress(0)
|
75 |
+
|
76 |
for response_token in stream:
|
77 |
total_tokens += len(response_token.token.text)
|
78 |
response_tokens.append(response_token.token.text)
|
79 |
response = ' '.join(response_tokens).replace('</s>', '')
|
80 |
progress = total_tokens / max_new_tokens
|
81 |
+
progress_bar.progress(progress)
|
82 |
|
83 |
audio_file = text_to_speech(response)
|
84 |
return response, audio_file
|