Spaces:
Runtime error
Runtime error
TA
commited on
Update app.py
Browse files
app.py
CHANGED
@@ -26,6 +26,9 @@ def post_request_beta(payload):
|
|
26 |
"""
|
27 |
Sends a POST request to the predefined Zephyr-7b-Beta URL and returns the JSON response.
|
28 |
"""
|
|
|
|
|
|
|
29 |
response = requests.post(zephyr_7b_beta, headers=HEADERS, json=payload)
|
30 |
response.raise_for_status() # Will raise an HTTPError if the HTTP request returned an unsuccessful status code
|
31 |
return response.json()
|
@@ -39,6 +42,8 @@ def predict_beta(message, chatbot=[], system_prompt=""):
|
|
39 |
|
40 |
try:
|
41 |
response_data = post_request_beta(data)
|
|
|
|
|
42 |
json_obj = response_data[0]
|
43 |
|
44 |
if 'generated_text' in json_obj and len(json_obj['generated_text']) > 0:
|
|
|
26 |
"""
|
27 |
Sends a POST request to the predefined Zephyr-7b-Beta URL and returns the JSON response.
|
28 |
"""
|
29 |
+
print(f"Sending payload: {payload}") # Debug print
|
30 |
+
print(f"Headers: {HEADERS}") # Debug print
|
31 |
+
|
32 |
response = requests.post(zephyr_7b_beta, headers=HEADERS, json=payload)
|
33 |
response.raise_for_status() # Will raise an HTTPError if the HTTP request returned an unsuccessful status code
|
34 |
return response.json()
|
|
|
42 |
|
43 |
try:
|
44 |
response_data = post_request_beta(data)
|
45 |
+
print(f"Response data: {response_data}") # Debug print
|
46 |
+
|
47 |
json_obj = response_data[0]
|
48 |
|
49 |
if 'generated_text' in json_obj and len(json_obj['generated_text']) > 0:
|