kumar9 commited on
Commit
557b429
1 Parent(s): 5d683ae

Update main.py

Browse files
Files changed (1) hide show
  1. main.py +5 -7
main.py CHANGED
@@ -14,19 +14,17 @@ import os
14
 
15
  app = Flask(__name__)
16
 
17
- import os
18
 
19
 
20
- # os.environ['API_URL'] = 'https://api-inference.huggingface.co/models/ProsusAI/finbert'
21
- # API_URL = "https://api-inference.huggingface.co/models/ProsusAI/finbert"
22
 
23
- api_key = os.getenv('API_KEY')
24
- api_url = os.getenv('API_URL')
25
 
26
- headers = {"Authorization": f"Bearer {api_key}"}
 
27
 
 
 
28
  def query(payload):
29
- response = requests.post(api_url, headers=headers, json=payload)
30
  return response.json()
31
 
32
 
 
14
 
15
  app = Flask(__name__)
16
 
 
17
 
18
 
 
 
19
 
 
 
20
 
21
+ # api_key = os.getenv('API_KEY')
22
+ # api_url = os.getenv('API_URL')
23
 
24
+ headers = {"Authorization": f"Bearer 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"}
25
+ API_URL = "https://api-inference.huggingface.co/models/ProsusAI/finbert"
26
  def query(payload):
27
+ response = requests.post(API_URL, headers=headers, json=payload)
28
  return response.json()
29
 
30