arnavmehta7 commited on
Commit
70ce783
1 Parent(s): ce0b8e8

Update inference.py

Browse files
Files changed (1) hide show
  1. inference.py +2 -2
inference.py CHANGED
@@ -3,11 +3,11 @@ from torch import Tensor
3
  import torch.nn as nn
4
  import torch.nn.functional as F
5
  import logging
6
- import json
7
  from typing import Optional, Dict, Type, Union, List, Tuple
8
  from pathlib import Path
9
  from dataclasses import dataclass
10
  import os
 
11
 
12
  from mars5.model import CodecLM, ResidualTransformer
13
  from vocos import Vocos
@@ -16,7 +16,7 @@ from mars5.diffuser import MultinomialDiffusion, DSH, perform_simple_inference
16
  from mars5.minbpe.regex import RegexTokenizer, GPT4_SPLIT_PATTERN
17
  from mars5.minbpe.codebook import CodebookTokenizer
18
  from mars5.ar_generate import ar_generate
19
- from mars5.utils import nuke_weight_norm
20
  from mars5.trim import trim
21
  from huggingface_hub import ModelHubMixin, hf_hub_download
22
  from safetensors import safe_open
 
3
  import torch.nn as nn
4
  import torch.nn.functional as F
5
  import logging
 
6
  from typing import Optional, Dict, Type, Union, List, Tuple
7
  from pathlib import Path
8
  from dataclasses import dataclass
9
  import os
10
+ import io
11
 
12
  from mars5.model import CodecLM, ResidualTransformer
13
  from vocos import Vocos
 
16
  from mars5.minbpe.regex import RegexTokenizer, GPT4_SPLIT_PATTERN
17
  from mars5.minbpe.codebook import CodebookTokenizer
18
  from mars5.ar_generate import ar_generate
19
+ from mars5.utils import nuke_weight_norm, construct_padding_mask
20
  from mars5.trim import trim
21
  from huggingface_hub import ModelHubMixin, hf_hub_download
22
  from safetensors import safe_open