Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -7,7 +7,7 @@ app = Flask(__name__)
|
|
7 |
|
8 |
# API_URL = "https://api-inference.huggingface.co/models/mistralai/Mixtral-8x7B-Instruct-v0.1"
|
9 |
# Use environment variables for configuration
|
10 |
-
API_URL =
|
11 |
# API_KEY = os.getenv("API_KEY", "your_default_api_key") # Default API_KEY can be set here
|
12 |
API_KEY = os.getenv("API_KEY")
|
13 |
|
@@ -64,7 +64,7 @@ def generate_text():
|
|
64 |
data = request.json
|
65 |
prompt = data.get("prompt")
|
66 |
instructions = data.get("instructions")
|
67 |
-
api_key =
|
68 |
|
69 |
if not prompt or not instructions or not api_key:
|
70 |
return jsonify({"error": "Missing required fields"}), 400
|
|
|
7 |
|
8 |
# API_URL = "https://api-inference.huggingface.co/models/mistralai/Mixtral-8x7B-Instruct-v0.1"
|
9 |
# Use environment variables for configuration
|
10 |
+
API_URL = "https://api-inference.huggingface.co/models/mistralai/Mixtral-8x7B-Instruct-v0.1"
|
11 |
# API_KEY = os.getenv("API_KEY", "your_default_api_key") # Default API_KEY can be set here
|
12 |
API_KEY = os.getenv("API_KEY")
|
13 |
|
|
|
64 |
data = request.json
|
65 |
prompt = data.get("prompt")
|
66 |
instructions = data.get("instructions")
|
67 |
+
api_key = API_KEY # Use the API key from the environment variable
|
68 |
|
69 |
if not prompt or not instructions or not api_key:
|
70 |
return jsonify({"error": "Missing required fields"}), 400
|