Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -49,7 +49,7 @@ def process_audio(microphone, state, task="transcribe"):
|
|
49 |
with torch.no_grad():
|
50 |
vicuna_input = vicuna_tokenizer(prompt, return_tensors="pt").to('cuda')
|
51 |
vicuna_output = vicuna_model.generate(**vicuna_input, max_new_tokens=192)
|
52 |
-
vicuna_response = vicuna_tokenizer.decode(vicuna_output, skip_special_tokens=True)
|
53 |
vicuna_response = vicuna_response.replace(prompt, "").strip()
|
54 |
updated_state = state + "\n" + vicuna_response
|
55 |
|
|
|
49 |
with torch.no_grad():
|
50 |
vicuna_input = vicuna_tokenizer(prompt, return_tensors="pt").to('cuda')
|
51 |
vicuna_output = vicuna_model.generate(**vicuna_input, max_new_tokens=192)
|
52 |
+
vicuna_response = vicuna_tokenizer.decode(vicuna_output[0], skip_special_tokens=True) # Access the first sequence [0]
|
53 |
vicuna_response = vicuna_response.replace(prompt, "").strip()
|
54 |
updated_state = state + "\n" + vicuna_response
|
55 |
|