Spaces:
Running on Zero
Running on Zero
File size: 2,492 Bytes
4791c0a | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 | {
"id": "build-small-hackathon/Structured-Data-Rescuer",
"slug": "Structured-Data-Rescuer",
"title": "Structured Data Rescuer",
"sdk": "gradio",
"declared_models": [],
"tags": [
"gradio",
"region:us"
],
"app_file": "app.py",
"README": "Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference Twitter: https://x.com/TensorVizion/status/2063351892579655922 HF: https://huggingface.co/posts/TensorVizion/709871862362183",
"APP_FILE": "from huggingface_hub import InferenceClient\n\nimport gradio as gr\nimport json\nimport os\nimport csv\nimport tempfile\nfrom huggingface_hub import InferenceClient\n\n# Replace this with your exact model repo ID\nMODEL_ID = \"meta-llama/Llama-3.1-8B-Instruct\" \n\n# Securely load the Hugging Face token from Space secrets\nhf_token = os.environ.get(\"HF_TOKEN\")\n\n# Initialize the HF inference client with the token\nclient = InferenceClient(model=MODEL_ID, token=hf_token)\n\n# -------------------------\n# Custom CSS Styling\n# -------------------------\ncustom_css = \"\"\"\n.hero-container {\n background: linear-gradient(135deg, #6366f1 0%, #14b8a6 100%);\n padding: 2.5rem;\n border-radius: 20px;\n color: white;\n margin-bottom: 2rem;\n box-shadow: 0 10px 25px -5px rgba(99, 102, 241, 0.2);\n}\n.hero-container h1 {\n color: white !important;\n font-size: 2.5rem !important;\n font-weight: 800 !important;\n margin-bottom: 0.5rem;\n text-shadow: 0 2px 4px rgba(0,0,0,0.1);\n}\n.hero-container p {\n color: rgba(255, 255, 255, 0.9) !important;\n font-size: 1.1rem !important;\n}\n.primary-btn {\n background: linear-gradient(90deg, #6366f1 0%, #14b8a6 100%) !important;\n border: none !important;\n color: white !important;\n font-weight: 600 !important;\n border-radius: 10px !important;\n transition: all 0.3s ease !important;\n padding: 12px 24px !important;\n}\n.primary-btn:hover {\n transform: translateY(-2px);\n box-shadow: 0 8px 20px -5px rgba(99, 102, 241, 0.4);\n}\n.secondary-btn {\n border-radius: 10px !important;\n font-weight: 600 !important;\n}\n.feedback-card {\n border-left: 4px solid #6366f1;\n background-color: rgba(99, 102, 241, 0.05);\n}\n\"\"\"\n\n# -------------------------\n# Helper & Extraction Logic\n# -------------------------\ndef generate_kpi_html(structured_data):\n \"\"\"Generates modern, responsive KPI metrics cards dynamically based on JSON data.\"\"\" ..."
} |