-
Notifications
You must be signed in to change notification settings - Fork 2.3k
feat: Qwen2.5-omni-7b full modal speech recognition #3870
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -30,8 +30,6 @@ def new_instance(model_type, model_name, model_credential: Dict[str, object], ** | |
optional_params['max_tokens'] = model_kwargs['max_tokens'] | ||
if 'temperature' in model_kwargs and model_kwargs['temperature'] is not None: | ||
optional_params['temperature'] = model_kwargs['temperature'] | ||
if model_name == 'qwen-omni-turbo': | ||
optional_params['streaming'] = True | ||
return AliyunBaiLianSpeechToText( | ||
model=model_name, | ||
api_key=model_credential.get('api_key'), | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The provided code snippet has some issues:
Here are the suggested improvements: from typing import Dict
def new_instance(
model_type: str,
model_name: str,
model_credential: Dict[str, Any],
**model_kwargs
) -> AliasBaiLianSpeechToText:
optional_params = {
"max_tokens": 1000, # Default value for max tokens, adjust as needed based on service documentation
"temperature": 0.7 # Default temperature for generation quality, adjust as needed
}
# Update optional parameters from kwargs if present and not None
if 'max_tokens' in model_kwargs and model_kwargs['max_tokens'] is not None:
optional_params['max_tokens'] = model_kwargs['max_tokens']
if 'temperature' in model_kwargs and model_kwargs['temperature'] is not None:
optional_params['temperature'] = model_kwargs['temperature']
# Enable streaming explicitly for Qwen-omni-turbo if necessary
if model_name.lower() == 'qwen-omni-turbo':
optional_params['streaming'] = True
return AliyunBaiLianSpeechToText(
model=model_name,
api_key=model_credential.get('api_key'),
**optional_params
) Key Changes:
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Review and Recommendations
Code Fragment: The code contains multiple changes across modules:
Changed
modelsProvider.modelsImpl.aliyunBaiLian.credential.omi_stt
tomodelsProvider.modelsImpl.aliyunBaiLian.credential.omni_stt
.Replaced occurrences of
_model_credential
with_modelcredential
.Added two new model entries:
Import Statements:
QwenVLModelCredential
toQwenVLChatModel
.Comments:
Overall Conclusion
No major technical issues were identified in this snippet. However, consider adding comments above each entry (like
ModelInfo
) explaining their purpose, given that they might not always be immediately self-explanatory without context.Additional Advice for Quality Assurance:
For robustness before release, consider these enhancements:
Feel free to add more detailed feedback or ask about specific areas if needed!