File tree 6 files changed +26
-9
lines changed
6 files changed +26
-9
lines changed Original file line number Diff line number Diff line change 1
1
import os
2
2
import argparse
3
3
import torch
4
- import ruamel_yaml as yaml
4
+ try :
5
+ import ruamel_yaml as yaml
6
+ except ModuleNotFoundError :
7
+ import ruamel .yaml as yaml
8
+
5
9
6
10
from model .prismer_caption import PrismerCaption
7
11
from dataset import create_dataset , create_loader
Original file line number Diff line number Diff line change @@ -15,4 +15,5 @@ pycocotools
15
15
geffnet
16
16
fire
17
17
huggingface_hub
18
- rich
18
+ rich
19
+ ruamel.yaml
Original file line number Diff line number Diff line change 5
5
# https://github.com/NVlabs/prismer/blob/main/LICENSE
6
6
7
7
import argparse
8
- import ruamel_yaml as yaml
9
8
import numpy as np
10
9
import random
11
10
import time
12
11
import functools
13
12
import json
14
13
import torch
15
14
import os
16
-
15
+ try :
16
+ import ruamel_yaml as yaml
17
+ except ModuleNotFoundError :
18
+ import ruamel .yaml as yaml
19
+
17
20
from accelerate import Accelerator , FullyShardedDataParallelPlugin
18
21
from model .prismer_caption import PrismerCaption
19
22
from model .modules .utils import interpolate_pos_embed
Original file line number Diff line number Diff line change 5
5
# https://github.com/NVlabs/prismer/blob/main/LICENSE
6
6
7
7
import argparse
8
- import ruamel_yaml as yaml
9
8
import numpy as np
10
9
import random
11
10
import time
12
11
import functools
13
12
import torch
13
+ try :
14
+ import ruamel_yaml as yaml
15
+ except ModuleNotFoundError :
16
+ import ruamel .yaml as yaml
14
17
15
18
from accelerate import Accelerator , FullyShardedDataParallelPlugin
16
19
from model .prismer_caption import PrismerCaption
Original file line number Diff line number Diff line change 5
5
# https://github.com/NVlabs/prismer/blob/main/LICENSE
6
6
7
7
import argparse
8
- import ruamel_yaml as yaml
9
8
import numpy as np
10
9
import random
11
10
import time
12
11
import datetime
13
12
import functools
14
13
import torch
15
-
14
+ try :
15
+ import ruamel_yaml as yaml
16
+ except ModuleNotFoundError :
17
+ import ruamel .yaml as yaml
18
+
16
19
from accelerate import Accelerator , FullyShardedDataParallelPlugin
17
20
from model .prismer_caption import PrismerCaption
18
21
from dataset import create_dataset , create_loader
Original file line number Diff line number Diff line change 5
5
# https://github.com/NVlabs/prismer/blob/main/LICENSE
6
6
7
7
import argparse
8
- import ruamel_yaml as yaml
9
8
import numpy as np
10
9
import random
11
10
import time
12
11
import datetime
13
12
import functools
14
13
import torch
15
-
14
+ try :
15
+ import ruamel_yaml as yaml
16
+ except ModuleNotFoundError :
17
+ import ruamel .yaml as yaml
18
+
16
19
from accelerate import Accelerator , FullyShardedDataParallelPlugin
17
20
from model .prismer_vqa import PrismerVQA
18
21
from model .modules .utils import interpolate_pos_embed
You can’t perform that action at this time.
0 commit comments