Update api_helper.py
Browse files- api_helper.py +2 -1
api_helper.py
CHANGED
|
@@ -1,4 +1,5 @@
|
|
| 1 |
import requests
|
|
|
|
| 2 |
|
| 3 |
# Constants
|
| 4 |
SPACE_URL = "https://abanm-dubs.hf.space/api/generate"
|
|
@@ -18,7 +19,7 @@ def call_api(message):
|
|
| 18 |
"Authorization": f"Bearer {API_KEY}",
|
| 19 |
"Content-Type": "application/json",
|
| 20 |
}
|
| 21 |
-
payload = {"
|
| 22 |
|
| 23 |
try:
|
| 24 |
# Send request with streaming enabled
|
|
|
|
| 1 |
import requests
|
| 2 |
+
import json
|
| 3 |
|
| 4 |
# Constants
|
| 5 |
SPACE_URL = "https://abanm-dubs.hf.space/api/generate"
|
|
|
|
| 19 |
"Authorization": f"Bearer {API_KEY}",
|
| 20 |
"Content-Type": "application/json",
|
| 21 |
}
|
| 22 |
+
payload = {"prompt": message} # Updated to match API's expected key
|
| 23 |
|
| 24 |
try:
|
| 25 |
# Send request with streaming enabled
|