Skip to content

Commit

Permalink
add the function
Browse files Browse the repository at this point in the history
  • Loading branch information
dansand committed May 6, 2024
1 parent 5178e8a commit f6bdbb8
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions .github/scripts/request_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,3 +118,16 @@ def check_uri(uri):
except Exception as err:
#return err.args[0]
return str(err) # 01/05/24: Convert the error to a string to avoid TypeError when we concatenate to log



def download_license_text(url):
try:
response = requests.get(url)
if response.status_code == 200:
return response.text
else:
return "# please refer to the metadata file (ro-crate-metadata.json) for information on model license"
except Exception as e:
print(f"Error downloading license text: {e}")
return "please refer to the metadata file (ro-crate-metadata.json) for information on model license"

0 comments on commit f6bdbb8

Please sign in to comment.