Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
Davidqian123 committed Nov 12, 2024
1 parent ee2d0e8 commit 1423a3f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
3 changes: 1 addition & 2 deletions nexa/gguf/nexa_inference_audio_lm.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,6 @@ def run(self):
user_input = nexa_prompt("Enter text (leave empty if no prompt): ")
with suppress_stdout_stderr():
response = self.inference(audio_path, user_input)
response = response.decode("utf-8") if isinstance(response, bytes) else response
print(f"{response}")

except KeyboardInterrupt:
Expand Down Expand Up @@ -201,7 +200,7 @@ def inference(self, audio_path: str, prompt: str = "") -> str:
response = audio_lm_cpp.process_full(
self.context, ctypes.byref(self.ctx_params), is_qwen=self.is_qwen
)
return response
return response.decode("utf-8") if isinstance(response, bytes) else response
except Exception as e:
raise RuntimeError(f"Error during inference: {str(e)}")
finally:
Expand Down
2 changes: 1 addition & 1 deletion nexa/gguf/streamlit/streamlit_audio_lm.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ def process_audio(nexa_model, audio_file, prompt=""):
try:
# Use the model's inference method directly
response = nexa_model.inference(temp_audio_path, prompt)
return response.decode("utf-8") if isinstance(response, bytes) else response
return response

except Exception as e:
st.error(f"Error during audio processing: {e}")
Expand Down

0 comments on commit 1423a3f

Please sign in to comment.