BillBojangeles2000 commited on
Commit
6746bb1
·
1 Parent(s): 740397e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -0
app.py CHANGED
@@ -7,7 +7,13 @@ import re
7
  import spacy
8
  import language_tool_python
9
  import json
 
 
10
 
 
 
 
 
11
  # Define the grammar_sense function
12
  def grammar_sense(sentence):
13
  sense = query({
 
7
  import spacy
8
  import language_tool_python
9
  import json
10
+ API_URL = "https://api-inference.huggingface.co/models/facebook/bart-large-mnli"
11
+ headers = {"Authorization": "Bearer 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"}
12
 
13
+ def query(payload):
14
+ response = requests.post(API_URL, headers=headers, json=payload)
15
+ return response.json()
16
+
17
  # Define the grammar_sense function
18
  def grammar_sense(sentence):
19
  sense = query({