SamSwift commited on
Commit
1abefa7
·
1 Parent(s): 3cf109e

Update inference.py

Browse files
Files changed (1) hide show
  1. inference.py +3 -3
inference.py CHANGED
@@ -32,11 +32,11 @@ def query(filename, lang):
32
 
33
  elif (lang == 'yo') and (filename is not None):
34
  API_URL = "https://api-inference.huggingface.co/models/Ayoola/cdial-yoruba-test"
35
- with open(filename, "rb") as f:
36
- data = f.read()
37
 
38
  try:
39
- response = httpx.request("POST", API_URL, headers=headers, data=data)
40
  command = json.loads(response.content.decode("utf-8"))
41
  command = command['text']
42
  if command != '':
 
32
 
33
  elif (lang == 'yo') and (filename is not None):
34
  API_URL = "https://api-inference.huggingface.co/models/Ayoola/cdial-yoruba-test"
35
+ #with open(filename, "rb") as f:
36
+ #data = f.read()
37
 
38
  try:
39
+ response = requests.request("POST", API_URL, headers=headers, data=filename)
40
  command = json.loads(response.content.decode("utf-8"))
41
  command = command['text']
42
  if command != '':