Spaces:
Sleeping
Sleeping
Gijs Wijngaard
commited on
Commit
·
e41bd20
1
Parent(s):
9d0b983
init
Browse files
app.py
CHANGED
|
@@ -54,6 +54,7 @@ def run_omni(audio_path: str, instruction: str, max_tokens: int = 512) -> str:
|
|
| 54 |
inputs = inputs.to(model.device)
|
| 55 |
|
| 56 |
output_ids = model.generate(**inputs, max_new_tokens=int(max_tokens))
|
|
|
|
| 57 |
response = processor.batch_decode(
|
| 58 |
output_ids, skip_special_tokens=True, clean_up_tokenization_spaces=False
|
| 59 |
)[0]
|
|
|
|
| 54 |
inputs = inputs.to(model.device)
|
| 55 |
|
| 56 |
output_ids = model.generate(**inputs, max_new_tokens=int(max_tokens))
|
| 57 |
+
output_ids = output_ids[:, inputs["input_ids"].shape[1]:]
|
| 58 |
response = processor.batch_decode(
|
| 59 |
output_ids, skip_special_tokens=True, clean_up_tokenization_spaces=False
|
| 60 |
)[0]
|