kumar9 commited on
Commit
6013fef
1 Parent(s): a793420

Update main.py

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