File size: 435 Bytes
df1aa82
4708837
 
df1aa82
4708837
 
 
 
 
df1aa82
4708837
df1aa82
1
2
3
4
5
6
7
8
9
10
11
12
13
import gradio as gr
import asyncio
from giskard.ml_worker.ml_worker import MLWorker

def run_ml_worker(url, api_key, hf_token):
    # Always run an external ML worker
    ml_worker = MLWorker(False, url, api_key, hf_token)
    asyncio.get_event_loop().run_until_complete(ml_worker.start())
    return "ML worker finished its work"

iface = gr.Interface(fn=run_ml_worker, inputs=["text", "text", "text"], outputs="text")
iface.launch()