R-Kentaren's picture
Upload folder using huggingface_hub
380204e verified
raw
history blame contribute delete
1.54 kB
"""Fullstack Code Builder β€” entry point.
Uses MiniCPM5-1B (text) or MiniCPM-V-4.6 (vision+text) for local inference.
No external APIs required.
Supports generating fullstack applications in any language.
Can push generated projects to HuggingFace Hub.
Web search via Google scraping (no API keys needed).
Gradio app support for Python.
Image understanding with MiniCPM-V-4.6.
Project structure:
code/
β”œβ”€β”€ config/constants.py App constants, model configs, system prompt
β”œβ”€β”€ model/loader.py Dual model loading & switching
β”œβ”€β”€ model/inference.py Streaming inference (text + VLM)
β”œβ”€β”€ execution/code_extractor.py Code extraction & language normalization
β”œβ”€β”€ execution/python_runner.py Sandboxed Python execution
β”œβ”€β”€ execution/gradio_runner.py Gradio app subprocess runner
β”œβ”€β”€ websearch/google_scraper.py Web search scraping (no API)
β”œβ”€β”€ huggingface/push.py HuggingFace Hub push & ZIP packaging
β”œβ”€β”€ server/chat_helpers.py Chat history & prompt building
└── server/routes.py FastAPI / Gradio server routes
"""
from __future__ import annotations
import logging
from code.model.loader import start_background_load
from code.server.routes import get_app
logging.basicConfig(level=logging.INFO)
logger = logging.getLogger(__name__)
# Start loading default model in background
start_background_load()
# Launch the server
application = get_app()
application.launch(show_error=True)