style: Run linter

This commit is contained in:
Paul Gauthier (aider) 2024-08-25 08:19:19 -07:00
parent 5473d99e13
commit 29bb70d407

View file

@ -4,13 +4,13 @@ import json
import math import math
import os import os
import platform import platform
import requests
import sys import sys
import time import time
from dataclasses import dataclass, fields from dataclasses import dataclass, fields
from pathlib import Path from pathlib import Path
from typing import Optional from typing import Optional
import requests
import yaml import yaml
from PIL import Image from PIL import Image
@ -440,9 +440,7 @@ def get_model_info(model):
cache_dir.mkdir(parents=True, exist_ok=True) cache_dir.mkdir(parents=True, exist_ok=True)
current_time = time.time() current_time = time.time()
cache_age = ( cache_age = current_time - cache_file.stat().st_mtime if cache_file.exists() else float("inf")
current_time - cache_file.stat().st_mtime if cache_file.exists() else float("inf")
)
if cache_file.exists() and cache_age < 86400: # 86400 seconds = 1 day if cache_file.exists() and cache_age < 86400: # 86400 seconds = 1 day
content = safe_read_json(cache_file) content = safe_read_json(cache_file)