TheVera commited on
Commit
e6e4784
·
verified ·
1 Parent(s): d18e30c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
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 = os.getenv("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,7 +64,7 @@ def generate_text():
64
  data = request.json
65
  prompt = data.get("prompt")
66
  instructions = data.get("instructions")
67
- api_key = data.get("api_key", API_KEY) # Use provided API key or default to environment variable
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