I am trying to get the pre-trained saved models from git repository into python and load them as the saved models into the tf.load_model() to future prediction. All though I successfully connected and able to pull the repo contents but my doubt is how do I load the content files into tf rather then loading using path? If that's not possible how would I get the path of the repository file once after connecting to the repositories present in my GitHub account?
I tried to load the files as path, of course it cant read it. Looking for a better way of doing it
from credentials import *
from github import Github
import requests
g = Github("token for access")
repos = g.get_user().get_repos()
for repo in repos:
print(repo)
content = repo.get_contents(path)
model = tf.keras.models.load_model(content[0],
custom_objects=None,
compile=True)
Error:
TypeError: expected str, bytes or os.PathLike object, not ContentFile