Gowtham M commited on
Commit
0ccab18
·
1 Parent(s): 82916db

Update Space

Browse files
Files changed (1) hide show
  1. app.py +1 -5
app.py CHANGED
@@ -6,12 +6,8 @@ API_URL = "https://api-inference.huggingface.co/models/gowtham58/T_TL"
6
  headers = {"Authorization": f"Bearer {TK}"}
7
 
8
  def get_output(text):
9
- response = requests.post(API_URL, headers=headers, json={"inputs": text,})
10
  response = response.json()
11
- #print(response)
12
- while response[0]=='error':
13
- response = requests.post(API_URL, headers=headers, json={"inputs": text,})
14
- response = response.json()
15
 
16
  return response[0]['generated_text']
17
 
 
6
  headers = {"Authorization": f"Bearer {TK}"}
7
 
8
  def get_output(text):
9
+ response = requests.post(API_URL, headers=headers, json={"inputs": text,"wait_for_model":True})
10
  response = response.json()
 
 
 
 
11
 
12
  return response[0]['generated_text']
13