Spaces:
Running
on
Zero
Running
on
Zero
fix
Browse files
app.py
CHANGED
@@ -57,9 +57,7 @@ def get_prediction(inputs, prompt: Optional[str]):
|
|
57 |
generate_kwargs['prompt_ids'] = pipe.tokenizer.get_prompt_ids(prompt, return_tensors='pt').to(device)
|
58 |
prediction = pipe(inputs, return_timestamps=True, generate_kwargs=generate_kwargs)
|
59 |
text = "".join([c['text'] for c in prediction['chunks']])
|
60 |
-
text_timestamped = "\n".join([
|
61 |
-
f"{format_time(*c['timestamp'])} {c['text']}" for c in prediction['chunks']
|
62 |
-
])
|
63 |
return text, text_timestamped
|
64 |
|
65 |
|
|
|
57 |
generate_kwargs['prompt_ids'] = pipe.tokenizer.get_prompt_ids(prompt, return_tensors='pt').to(device)
|
58 |
prediction = pipe(inputs, return_timestamps=True, generate_kwargs=generate_kwargs)
|
59 |
text = "".join([c['text'] for c in prediction['chunks']])
|
60 |
+
text_timestamped = "\n".join([f"{format_time(*c['timestamp'])} {c['text']}" for c in prediction['chunks']])
|
|
|
|
|
61 |
return text, text_timestamped
|
62 |
|
63 |
|