foxxy-hm commited on
Commit
0ebfdf7
1 Parent(s): d201e83

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -5
app.py CHANGED
@@ -8,11 +8,11 @@ API_URL = "https://api-inference.huggingface.co/models/foxxy-hm/mt5-small-finetu
8
  headers = {"Authorization": f"Bearer {SECRET_TOKEN}"}
9
 
10
  def query(payload):
11
- try:
12
- response = requests.post(API_URL, headers=headers, json=payload)
13
- return response.json()[0]["generated_text"]
14
- except Exception as e: # catch any kind of error
15
- return f"Error: {e}" # return the error message
16
 
17
 
18
  examples = [
 
8
  headers = {"Authorization": f"Bearer {SECRET_TOKEN}"}
9
 
10
  def query(payload):
11
+ # try:
12
+ response = requests.post(API_URL, headers=headers, json=payload)
13
+ return response.json()[0]["generated_text"]
14
+ # except Exception as e: # catch any kind of error
15
+ # return f"Error: {e}" # return the error message
16
 
17
 
18
  examples = [