Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ENH: add model config for Whisper #2755

Merged
merged 4 commits into from
Jan 14, 2025
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
FIX: move max_new_tokens to generate_kwargs
  • Loading branch information
fonsc committed Jan 10, 2025
commit 95ec81b39b4e3ee902d1a1a895fb6e147ce52326
11 changes: 5 additions & 6 deletions xinference/model/audio/whisper.py
Original file line number Diff line number Diff line change
@@ -98,7 +98,6 @@ def load(self):
model=model,
tokenizer=processor.tokenizer,
feature_extractor=processor.feature_extractor,
max_new_tokens=self._max_new_tokens,
chunk_length_s=self._model_config.get("chunk_length_s"),
stride_length_s=self._model_config.get("stride_length_s"),
return_timestamps=self._model_config.get("return_timestamps"),
@@ -209,13 +208,13 @@ def transcriptions(
logger.warning(
"Prompt for whisper transcriptions will be ignored: %s", prompt
)
generate_kwargs = {"max_new_tokens": self._max_new_tokens, "task": "transcribe"}
if language is not None:
generate_kwargs["language"] = language

return self._call_model(
audio=audio,
generate_kwargs=(
{"language": language, "task": "transcribe"}
if language is not None
else {"task": "transcribe"}
),
generate_kwargs=generate_kwargs,
response_format=response_format,
temperature=temperature,
timestamp_granularities=timestamp_granularities,
Loading