Spaces:
Runtime error
Runtime error
| import requests | |
| import json | |
| from config import HUGGINGFACE_API_URL, HUGGINGFACE_API_KEY | |
| HEADERS = {"Authorization": f"Bearer {HUGGINGFACE_API_KEY}"} | |
| def analyze_resume(text): | |
| """Send resume text to Google Gemini model via Hugging Face API.""" | |
| data = {"inputs": text} | |
| response = requests.post(HUGGINGFACE_API_URL, headers=HEADERS, data=json.dumps(data)) | |
| if response.status_code == 200: | |
| return response.json()["output"] | |
| return {"score": 0, "summary": "Error processing resume"} |