Spaces:
Runtime error
Runtime error
Create app.py
Browse files
app.py
ADDED
@@ -0,0 +1,15 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import os
|
2 |
+
import gradio as gr
|
3 |
+
import gradio_client as grc
|
4 |
+
|
5 |
+
# Access environment variables
|
6 |
+
hf_token = os.environ.get("HF_TOKEN")
|
7 |
+
inference_endpoint = os.environ.get("INFERENCE_ENDPOINT")
|
8 |
+
|
9 |
+
# Check if the environment variables are set
|
10 |
+
if hf_token is None or inference_endpoint is None:
|
11 |
+
raise ValueError("HF_TOKEN or INFERENCE_ENDPOINT environment variable not set")
|
12 |
+
|
13 |
+
secrets = {"HF_TOKEN": hf_token, "INFERENCE_ENDPOINT": inference_endpoint}
|
14 |
+
import gradio_client as grc
|
15 |
+
grc.Client("TeamTonic/mistralmeddiscordbot").deploy_discord(api_names=["mistralmed"])
|