async def sync():
    urls = ['http://localhost:8001/modeltrain', 'http://localhost:8002/modeltrain']
    tasks = []

    async with aiohttp.ClientSession() as session:
        for url in URLS:
            tasks.append(fetch(session, url))
        results = await asyncio.gather(*tasks)
    model_aggregation()
    send_agg_to_clients()
def perform_model_aggregation():
    model_aggregation()
    return render_template("agg.html")
Exemple #3
0
def perform_model_aggregation():
    model_aggregation()
    return 'Model aggregation done!\nGlobal model written to persistent storage.'