Update app.py
Browse files
app.py
CHANGED
@@ -87,8 +87,6 @@ model = AutoModelForCausalLM.from_pretrained(
|
|
87 |
# assistant_model.eval()
|
88 |
model.eval()
|
89 |
|
90 |
-
early_exit_layer = 4
|
91 |
-
|
92 |
basic_model_config = './xcodec_mini_infer/final_ckpt/config.yaml'
|
93 |
resume_path = './xcodec_mini_infer/final_ckpt/ckpt_00360000.pth'
|
94 |
config_path = './xcodec_mini_infer/decoders/config.yaml'
|
@@ -234,13 +232,11 @@ def generate_music(
|
|
234 |
repetition_penalty=repetition_penalty,
|
235 |
eos_token_id=mmtokenizer.eoa,
|
236 |
pad_token_id=mmtokenizer.eoa,
|
237 |
-
logits_processor=LogitsProcessorList([BlockTokenRangeProcessor(0, 32002),
|
238 |
-
BlockTokenRangeProcessor(32016, 32016)]),
|
239 |
guidance_scale=guidance_scale,
|
240 |
use_cache=True,
|
241 |
top_k=50,
|
242 |
-
num_beams=1
|
243 |
-
assistant_early_exit=early_exit_layer
|
244 |
)
|
245 |
if output_seq[0][-1].item() != mmtokenizer.eoa:
|
246 |
tensor_eoa = torch.as_tensor([[mmtokenizer.eoa]]).to(model.device)
|
|
|
87 |
# assistant_model.eval()
|
88 |
model.eval()
|
89 |
|
|
|
|
|
90 |
basic_model_config = './xcodec_mini_infer/final_ckpt/config.yaml'
|
91 |
resume_path = './xcodec_mini_infer/final_ckpt/ckpt_00360000.pth'
|
92 |
config_path = './xcodec_mini_infer/decoders/config.yaml'
|
|
|
232 |
repetition_penalty=repetition_penalty,
|
233 |
eos_token_id=mmtokenizer.eoa,
|
234 |
pad_token_id=mmtokenizer.eoa,
|
235 |
+
# logits_processor=LogitsProcessorList([BlockTokenRangeProcessor(0, 32002), BlockTokenRangeProcessor(32016, 32016)]),
|
|
|
236 |
guidance_scale=guidance_scale,
|
237 |
use_cache=True,
|
238 |
top_k=50,
|
239 |
+
num_beams=1
|
|
|
240 |
)
|
241 |
if output_seq[0][-1].item() != mmtokenizer.eoa:
|
242 |
tensor_eoa = torch.as_tensor([[mmtokenizer.eoa]]).to(model.device)
|