Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -156,12 +156,16 @@ def transcribe(stream, new_chunk):
|
|
156 |
chat_messages = chat.to_list()
|
157 |
output=LM_pipe(
|
158 |
chat_messages,
|
159 |
-
max_new_tokens=
|
160 |
min_new_tokens=0,
|
161 |
temperature=0.0,
|
162 |
do_sample=False,
|
163 |
)
|
164 |
-
|
|
|
|
|
|
|
|
|
165 |
print("--- %s seconds ---" % (time.time() - start_time))
|
166 |
generated_text = output[0]['generated_text'][-1]["content"]
|
167 |
print(generated_text)
|
|
|
156 |
chat_messages = chat.to_list()
|
157 |
output=LM_pipe(
|
158 |
chat_messages,
|
159 |
+
max_new_tokens=128,
|
160 |
min_new_tokens=0,
|
161 |
temperature=0.0,
|
162 |
do_sample=False,
|
163 |
)
|
164 |
+
if output.endswith((".", "?", "!", "<|end|>")):
|
165 |
+
print(output)
|
166 |
+
else:
|
167 |
+
output=".".join(output.split(".")[:-1])+"."
|
168 |
+
|
169 |
print("--- %s seconds ---" % (time.time() - start_time))
|
170 |
generated_text = output[0]['generated_text'][-1]["content"]
|
171 |
print(generated_text)
|