Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -7,9 +7,11 @@ from io import StringIO
|
|
7 |
import os
|
8 |
from flask import Flask, request, jsonify
|
9 |
|
10 |
-
# Accessing the token from environment variables
|
11 |
hf_token = os.getenv('HF_API_TOKEN')
|
12 |
|
|
|
|
|
|
|
13 |
# Ensure that you load the token before making API requests
|
14 |
|
15 |
# Set environment variable to avoid floating-point errors
|
|
|
7 |
import os
|
8 |
from flask import Flask, request, jsonify
|
9 |
|
|
|
10 |
hf_token = os.getenv('HF_API_TOKEN')
|
11 |
|
12 |
+
if not hf_token:
|
13 |
+
raise ValueError("Hugging Face API token is not set. Please set the HF_API_TOKEN environment variable.")
|
14 |
+
|
15 |
# Ensure that you load the token before making API requests
|
16 |
|
17 |
# Set environment variable to avoid floating-point errors
|