Upload folder using huggingface_hub
Browse files- README.md +4 -2
- modeling_midashenglm.py +0 -2
README.md
CHANGED
|
@@ -42,6 +42,7 @@ TODO:以下由Qwen2.5-Omni-3B依赖,引入路径未知,需要去除
|
|
| 42 |
```python
|
| 43 |
>>> from transformers import AutoModelForCausalLM, AutoProcessor
|
| 44 |
>>> model = AutoModelForCausalLM.from_pretrained("zhoukz/MiDashengLM-HF-dev", trust_remote_code=True)
|
|
|
|
| 45 |
>>> processor = AutoProcessor.from_pretrained("zhoukz/MiDashengLM-HF-dev", trust_remote_code=True)
|
| 46 |
|
| 47 |
>>> import torchaudio
|
|
@@ -49,8 +50,9 @@ TODO:以下由Qwen2.5-Omni-3B依赖,引入路径未知,需要去除
|
|
| 49 |
>>> assert sr == 16000
|
| 50 |
>>> text = ["<|im_start|>system\\nYou are a helpful language and speech assistant.<|im_end|>\\n<|im_start|>user\\nCaption the audio<|audio_bos|><|AUDIO|><|audio_eos|><|im_end|>\\n<|im_start|>assistant\\n'"]
|
| 51 |
|
| 52 |
-
>>>
|
| 53 |
-
|
|
|
|
| 54 |
>>> print(output)
|
| 55 |
["An engine is idling.'"]
|
| 56 |
```
|
|
|
|
| 42 |
```python
|
| 43 |
>>> from transformers import AutoModelForCausalLM, AutoProcessor
|
| 44 |
>>> model = AutoModelForCausalLM.from_pretrained("zhoukz/MiDashengLM-HF-dev", trust_remote_code=True)
|
| 45 |
+
>>> model.eval()
|
| 46 |
>>> processor = AutoProcessor.from_pretrained("zhoukz/MiDashengLM-HF-dev", trust_remote_code=True)
|
| 47 |
|
| 48 |
>>> import torchaudio
|
|
|
|
| 50 |
>>> assert sr == 16000
|
| 51 |
>>> text = ["<|im_start|>system\\nYou are a helpful language and speech assistant.<|im_end|>\\n<|im_start|>user\\nCaption the audio<|audio_bos|><|AUDIO|><|audio_eos|><|im_end|>\\n<|im_start|>assistant\\n'"]
|
| 52 |
|
| 53 |
+
>>> with torch.no_grad():
|
| 54 |
+
... model_inputs = processor(text=text, audio=audio)
|
| 55 |
+
... output = model.generate(**model_inputs)
|
| 56 |
>>> print(output)
|
| 57 |
["An engine is idling.'"]
|
| 58 |
```
|
modeling_midashenglm.py
CHANGED
|
@@ -667,8 +667,6 @@ class DashengQwen25OmniModelInstruct(PreTrainedModel):
|
|
| 667 |
subsample_factor = config.subsample_factor
|
| 668 |
use_encoderattention_mask = config.use_encoderattention_mask
|
| 669 |
resize_tokenizer = True
|
| 670 |
-
lora_r = 8
|
| 671 |
-
lora_target_modules = ("q_proj", "v_proj")
|
| 672 |
force_fp32 = False
|
| 673 |
|
| 674 |
from transformers.models.qwen2_5_omni import (
|
|
|
|
| 667 |
subsample_factor = config.subsample_factor
|
| 668 |
use_encoderattention_mask = config.use_encoderattention_mask
|
| 669 |
resize_tokenizer = True
|
|
|
|
|
|
|
| 670 |
force_fp32 = False
|
| 671 |
|
| 672 |
from transformers.models.qwen2_5_omni import (
|