Spaces:
Runtime error
Runtime error
Update inference.py
Browse files- 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 =
|
| 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 != '':
|