Spaces:
Sleeping
Sleeping
Michael Arana
Add ZeroGPU backend so any HF model runs on Space GPU (default XHToken/Spark-X2.5-4B)
042d836 |
Download README.md from gamer729/algorithm-finder: direct link, hf CLI and curl.
- Browser
- Download file 2 kB
-
https://huggingface.co/spaces/gamer729/algorithm-finder/resolve/main/README.md
- Command line
-
hf download hf://spaces/gamer729/algorithm-finder/README.md
-
curl -L -o README.md https://huggingface.co/spaces/gamer729/algorithm-finder/resolve/main/README.md
2 kB
A newer version of the Gradio SDK is available: 6.30.0
metadata
title: Algorithm Finder
emoji: 🔍
colorFrom: blue
colorTo: blue
sdk: gradio
sdk_version: 6.19.0
python_version: '3.10'
app_file: app.py
pinned: false
hardware: zero-gpu
Algorithm Finder
Find the best algorithm for any code/math problem using LLM-powered C++ agents, compiled and benchmarked locally (Zero GPU).
How It Works
- Initial Coder: Generates a compilable C++ solution for your problem.
- Researcher: Generates N novel alternative C++ algorithms.
- Validator: Evaluates all candidates against performance metrics and selects a winner.
- If no winner passes, it regenerates N new algorithms (up to
max_validation_rounds).
- If no winner passes, it regenerates N new algorithms (up to
- Real-World Tester: Tests the winner against the baseline in N realistic scenarios.
- Summary: Displays a Markdown summary of the winning algorithm and results.
Setup
Local
pip install -r requirements.txt
python app.py
Hugging Face Spaces (Zero GPU)
- Create a new Space with the Gradio SDK.
- Set
app.pyas the entrypoint. - Add
requirements.txt. - (Optional) Add your
HF_TOKENas a Space secret. - Deploy.
Usage
- Problem Description: Describe the problem you want to optimize.
- Objective: What you are trying to optimize (speed, memory, accuracy, etc.).
- User-defined Metric: A custom metric the validator should prioritize.
- Model ID: Any Hugging Face Instruct model (e.g.,
meta-llama/Meta-Llama-3-8B-Instruct). - Number of candidate algorithms: How many new algorithms the researcher generates per round.
- Number of real-world scenarios: How many scenarios the winner is tested in.
- Max validation rounds: How many times to regenerate if no winner is found.
Notes
- This app uses the Hugging Face Inference API (free tier or Pro) to run LLMs.
- C++ compilation happens locally using
g++. - Execution time and memory usage are measured for each algorithm.
- All code is generated and executed within the app sandbox.