fahmifauzi commited on
Commit
583a697
·
verified ·
1 Parent(s): 8b5bc64

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -1
app.py CHANGED
@@ -1,8 +1,10 @@
1
  #Text-generation endpoint for the mistral model
2
  import requests, json
 
3
 
 
4
  API_URL = "https://api-inference.huggingface.co/models/mistralai/Mistral-7B-Instruct-v0.1"
5
- headers = {"Authorization": "Bearer HF_TOKEN",
6
  "Content-Type": "application/json"}
7
 
8
  def query(inputs, parameters=None, ENDPOINT_URL=API_URL):
 
1
  #Text-generation endpoint for the mistral model
2
  import requests, json
3
+ import os
4
 
5
+ hf_api_key = os.environ.get("HF_TOKEN")
6
  API_URL = "https://api-inference.huggingface.co/models/mistralai/Mistral-7B-Instruct-v0.1"
7
+ headers = {"Authorization": f"Bearer {hf_api_key}",
8
  "Content-Type": "application/json"}
9
 
10
  def query(inputs, parameters=None, ENDPOINT_URL=API_URL):