File size: 650 Bytes
14692c9 45100a5 14692c9 c149100 3a14ca4 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
import os
import gradio as gr
# Access environment variables
hf_token = os.environ.get("HF_TOKEN")
inference_endpoint = os.environ.get("INFERENCE_ENDPOINT")
# Check if the environment variables are set
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}
gr.client("TeamTonic/coherebot", private=False, secrets=secrets, sleep_timeout=2880).deploy_discord(to_id="predict")
# client = gr.Client.duplicate("gradio-discord-bots/falcon-7b-instruct"
# client.deploy_discord(api_names=["predict"]) |