Spaces:
Sleeping
Sleeping
Update frontend.py
Browse files- frontend.py +2 -3
frontend.py
CHANGED
|
@@ -6,9 +6,8 @@ history = []
|
|
| 6 |
|
| 7 |
def calculate(expression):
|
| 8 |
try:
|
| 9 |
-
#
|
| 10 |
-
|
| 11 |
-
api_url = f"{base_url}/calculate"
|
| 12 |
|
| 13 |
response = requests.post(api_url, json={"expr": expression})
|
| 14 |
if response.status_code == 200:
|
|
|
|
| 6 |
|
| 7 |
def calculate(expression):
|
| 8 |
try:
|
| 9 |
+
# Use relative URL, which works both locally and on Hugging Face Spaces
|
| 10 |
+
api_url = "/calculate"
|
|
|
|
| 11 |
|
| 12 |
response = requests.post(api_url, json={"expr": expression})
|
| 13 |
if response.status_code == 200:
|