Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -4,7 +4,12 @@ import gradio as gr
|
|
4 |
from magika import Magika
|
5 |
from huggingface_hub import login
|
6 |
|
7 |
-
|
|
|
|
|
|
|
|
|
|
|
8 |
|
9 |
SUPPORTED_FILE_TYPES = ["txt", "python", "markdown", "yaml", "json", "csv", "tsv", "xml", "html"]
|
10 |
|
|
|
4 |
from magika import Magika
|
5 |
from huggingface_hub import login
|
6 |
|
7 |
+
# Get the HF token from environment variables
|
8 |
+
hf_token = os.getenv("HF_TOKEN")
|
9 |
+
if hf_token:
|
10 |
+
login(token=hf_token)
|
11 |
+
else:
|
12 |
+
raise ValueError("HF_TOKEN environment variable is not set")
|
13 |
|
14 |
SUPPORTED_FILE_TYPES = ["txt", "python", "markdown", "yaml", "json", "csv", "tsv", "xml", "html"]
|
15 |
|