/heavy_load.py Secret
Created
February 27, 2021 21:46
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def main(req: func.HttpRequest, context: func.Context) -> func.HttpResponse: | |
logging.info('Python HTTP trigger function processed a request.') | |
global model | |
if not model: | |
model = faster_rcnn.model(num_classes=len(class_map)) | |
model_path = os.path.join(context.function_directory, 'quiddler.pt') | |
model.load_state_dict(torch.load(model_path, map_location=torch.device("cpu"))) | |
# ... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment