Make new non_compete optional, also ipfs_gateway

pull/26/head
Guillermo Rodriguez 2023-10-07 11:11:47 -03:00
parent b7b267a71b
commit 7cd539a944
No known key found for this signature in database
GPG Key ID: EC3AB66D5D83B392
2 changed files with 13 additions and 7 deletions

View File

@ -27,6 +27,9 @@ class SkynetDGPUDaemon:
config['auto_withdraw']
if 'auto_withdraw' in config else False
)
self.non_compete = set()
if 'non_compete' in config:
self.non_compete = set(config['non_compete'])
self.model_whitelist = set()

View File

@ -47,6 +47,8 @@ class SkynetGPUConnector:
self.cleos = CLEOS(
None, None, self.node_url, remote=self.node_url)
self.ipfs_gateway_url = None
if 'ipfs_gateway_url' in config:
self.ipfs_gateway_url = config['ipfs_gateway_url']
self.ipfs_url = config['ipfs_url']
@ -202,6 +204,7 @@ class SkynetGPUConnector:
img = Image.open(io.BytesIO(raw_img))
img.save('ipfs-staging/image.png')
if self.ipfs_gateway_url:
# check peer connections, reconnect to skynet gateway if not
gateway_id = Path(self.ipfs_gateway_url).name
peers = await self.ipfs_client.peers()