Spaces:
Running
Running
File size: 1,525 Bytes
ccb935d | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 | """SoniCoder β 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)
|