ford442 commited on
Commit
2048877
·
verified ·
1 Parent(s): 34172eb

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -1
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