[Bug Fix] Update demo code to work with the latest transformers library version
#25
by haolinwu - opened
README.md
CHANGED
|
@@ -68,8 +68,8 @@ for message in conversation:
|
|
| 68 |
sr=processor.feature_extractor.sampling_rate)[0]
|
| 69 |
)
|
| 70 |
|
| 71 |
-
inputs = processor(text=text,
|
| 72 |
-
inputs
|
| 73 |
|
| 74 |
generate_ids = model.generate(**inputs, max_length=256)
|
| 75 |
generate_ids = generate_ids[:, inputs.input_ids.size(1):]
|
|
@@ -116,8 +116,8 @@ for message in conversation:
|
|
| 116 |
sr=processor.feature_extractor.sampling_rate)[0]
|
| 117 |
)
|
| 118 |
|
| 119 |
-
inputs = processor(text=text,
|
| 120 |
-
inputs
|
| 121 |
|
| 122 |
generate_ids = model.generate(**inputs, max_length=256)
|
| 123 |
generate_ids = generate_ids[:, inputs.input_ids.size(1):]
|
|
@@ -171,9 +171,9 @@ for conversation in conversations:
|
|
| 171 |
sr=processor.feature_extractor.sampling_rate)[0]
|
| 172 |
)
|
| 173 |
|
| 174 |
-
inputs = processor(text=text,
|
| 175 |
inputs['input_ids'] = inputs['input_ids'].to("cuda")
|
| 176 |
-
inputs
|
| 177 |
|
| 178 |
generate_ids = model.generate(**inputs, max_length=256)
|
| 179 |
generate_ids = generate_ids[:, inputs.input_ids.size(1):]
|
|
|
|
| 68 |
sr=processor.feature_extractor.sampling_rate)[0]
|
| 69 |
)
|
| 70 |
|
| 71 |
+
inputs = processor(text=text, audio=audios, return_tensors="pt", padding=True)
|
| 72 |
+
inputs = inputs.to("cuda")
|
| 73 |
|
| 74 |
generate_ids = model.generate(**inputs, max_length=256)
|
| 75 |
generate_ids = generate_ids[:, inputs.input_ids.size(1):]
|
|
|
|
| 116 |
sr=processor.feature_extractor.sampling_rate)[0]
|
| 117 |
)
|
| 118 |
|
| 119 |
+
inputs = processor(text=text, audio=audios, return_tensors="pt", padding=True)
|
| 120 |
+
inputs = inputs.to("cuda")
|
| 121 |
|
| 122 |
generate_ids = model.generate(**inputs, max_length=256)
|
| 123 |
generate_ids = generate_ids[:, inputs.input_ids.size(1):]
|
|
|
|
| 171 |
sr=processor.feature_extractor.sampling_rate)[0]
|
| 172 |
)
|
| 173 |
|
| 174 |
+
inputs = processor(text=text, audio=audios, return_tensors="pt", padding=True)
|
| 175 |
inputs['input_ids'] = inputs['input_ids'].to("cuda")
|
| 176 |
+
inputs = inputs.to("cuda")
|
| 177 |
|
| 178 |
generate_ids = model.generate(**inputs, max_length=256)
|
| 179 |
generate_ids = generate_ids[:, inputs.input_ids.size(1):]
|