|
import os |
|
import gradio as gr |
|
import gradio_client as grc |
|
|
|
|
|
hf_token = os.environ.get("HF_TOKEN") |
|
inference_endpoint = os.environ.get("INFERENCE_ENDPOINT") |
|
|
|
|
|
if hf_token is None or inference_endpoint is None: |
|
raise ValueError("HF_TOKEN or INFERENCE_ENDPOINT environment variable not set") |
|
|
|
secrets = {"HF_TOKEN": hf_token, "INFERENCE_ENDPOINT": inference_endpoint} |
|
import gradio_client as grc |
|
grc.Client("TeamTonic/coherebot", private=False, secrets=secrets, sleep_timeout=2880).deploy_discord(to_id=["predict"]) |