Spaces:
Sleeping
Sleeping
import requests | |
BASE_URL = "https://osnarayana-media-gen-api.hf.space/api/v1/metrics" | |
TOKEN = "my_secure_token_123" # must match app/auth/auth.py | |
headers = { | |
"Authorization": f"Bearer {TOKEN}", | |
"Content-Type": "application/json" | |
} | |
# 1️⃣ BLEU | |
bleu_payload = {"reference": "hello world", "candidate": "hello"} | |
r1 = requests.post(f"{BASE_URL}/evaluate/bleu", headers=headers, params={"reference": "hello world", "candidate": "hello"}) | |
print("BLEU Response:", r1.status_code, r1.text) | |
# 2️⃣ CLIPScore | |
clip_payload = {"reference": "a photo of a cat", "candidate": "an image of a cute cat"} | |
r2 = requests.post(f"{BASE_URL}/evaluate/clipscore", headers=headers, params={"reference": "a photo of a cat", "candidate": "an image of a cute cat"}) | |
print("CLIPScore Response:", r2.status_code, r2.text) | |