CoolFace
Apppublic

Rockingstar1/llm-human-code-detection

sourceHugging Faceupdated 5mo agoView on Hugging Face
0likes
DEPLOYMENT.md127 linesDownload Raw Back to root
1# Deployment Guide2 3## Recommended Free Option4 5Use **Reflex Cloud free tier** first.6 7Why this is the best fit for this project:8 9- The UI is a real Reflex app, not just static HTML.10- Predictions run through Python backend code.11- Reflex Cloud is the most direct deployment target for Reflex apps.12 13Official docs:14 15- https://reflex.dev/docs/hosting/deploy-quick-start/16- https://reflex.dev/docs/hosting/cli/deploy/17- https://reflex.dev/blog/reflex-cloud18 19## Important Project Detail20 21This repository keeps the Reflex app in `reflex_ui/`, but the runtime classifier code lives outside it in:22 23- `classifier/`24- `featureextraction/`25- `xai/`26- `models/`27 28Because of that, deploy from the **repository root** and pass the config path explicitly:29 30```bash31reflex deploy --config-path reflex_ui/rxconfig.py32```33 34That gives the deployment access to the whole repository instead of only the `reflex_ui` folder.35 36## Step-by-Step: Reflex Cloud37 381. Push this repository to GitHub.39 402. Open a terminal in the repository root:41 42```bash43cd "c:\Users\Dhanusri.T\Downloads\LLM GENERATED CODE VS HUMAN CODE UI\LLM GENERATED CODE VS HUMAN CODE"44```45 463. Create and activate a virtual environment if you want a clean setup:47 48```bash49python -m venv .venv50.venv\Scripts\activate51```52 534. Install dependencies:54 55```bash56python -m pip install --upgrade pip57python -m pip install -r requirements.txt58```59 60Use Python 3.11 or newer. Python 3.12 is a good default for this project.61 625. Test locally once before deploying:63 64```bash65cd reflex_ui66reflex run67```68 69Open the local URL shown by Reflex and make sure one prediction works.70 716. Go back to the repository root:72 73```bash74cd ..75```76 777. Log in to Reflex Cloud:78 79```bash80reflex login81```82 83This opens the browser for authentication.84 858. Deploy:86 87```bash88reflex deploy --config-path reflex_ui/rxconfig.py89```90 919. During the prompts:92 93- Confirm the app name.94- Keep the generated hostname unless you want to rename it.95- If asked about `requirements.txt`, use the current file.96 9710. Wait for the build to finish, then open the provided `*.reflex.run` URL.98 99## If Reflex Cloud Fails100 101The most likely reasons are:102 103- `torch` or `transformers` makes the build heavy.104- Startup is slow because `microsoft/unixcoder-base` downloads on first boot.105- Free-tier compute or memory is not enough.106 107## Best Free Fallback108 109Use **Hugging Face Spaces (Docker)**.110 111Official docs:112 113- https://huggingface.co/docs/hub/spaces-overview114 115Why it helps:116 117- Free CPU hardware is available.118- It is often more forgiving for ML demo apps.119- You can containerize the full repo and avoid subdirectory packaging issues.120 121## Practical Recommendation122 123Try this order:124 1251. Reflex Cloud with `--config-path reflex_ui/rxconfig.py`1262. Hugging Face Spaces with Docker if the Reflex free deployment struggles127