mirror of
https://github.com/MarioSpore/Grinch-AP.git
synced 2025-10-21 20:21:32 -06:00
refix yaml laoding
This commit is contained in:
@@ -140,8 +140,9 @@ def main():
|
||||
|
||||
def get_weights(path):
|
||||
try:
|
||||
parsed_url = urllib.parse.urlparse(path)
|
||||
if all(parsed_url.scheme, parsed_url.netloc, parsed_url.path):
|
||||
if urllib.parse.urlparse(path).scheme:
|
||||
yaml = str(urllib.request.urlopen(path).read(), "utf-8")
|
||||
else:
|
||||
with open(path, 'rb') as f:
|
||||
yaml = str(f.read(), "utf-8")
|
||||
except Exception as e:
|
||||
|
||||
Reference in New Issue
Block a user