File size: 546 Bytes
6459994
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
import os
import sys
import torch


def load_models():
    '''
    Checks CUDA availability & loads models
    '''
    try:
        print(f"CUDA Available: {torch.cuda.is_available()}")
        print(f"CUDA Device: {torch.cuda.get_device_name(torch.cuda.current_device())}")
        
        # TODO: Load Models Code Here (Refactor Exisitng Models Loading)
        MODELS = {}
        return MODELS

    except KeyboardInterrupt:
        print('Interrupted')
        try:
            sys.exit(0)
        except SystemExit:
            os._exit(0)