|
from constants import * |
|
from hf_client import get_inference_client, tavily_client |
|
from tavily_search import enhance_query_with_search |
|
from utils import * |
|
from search_replace import * |
|
from web_scraper import * |
|
from deploy import * |
|
|
|
with gr.Blocks( |
|
theme=gr.themes.Base( |
|
primary_hue="blue", |
|
secondary_hue="gray", |
|
neutral_hue="gray", |
|
font=gr.themes.GoogleFont("Inter"), |
|
font_mono=gr.themes.GoogleFont("JetBrains Mono"), |
|
text_size=gr.themes.sizes.text_md, |
|
spacing_size=gr.themes.sizes.spacing_md, |
|
radius_size=gr.themes.sizes.radius_md |
|
), |
|
title="AnyCoder - AI Code Generator" |
|
) as demo: |
|
history=gr.State([]) |
|
setting=gr.State({"system": HTML_SYSTEM_PROMPT}) |
|
current_model=gr.State(AVAILABLE_MODELS[9]) |
|
open_panel=gr.State(None) |
|
last_login_state=gr.State(None) |
|
|
|
|
|
|
|
|
|
def generation_code(query, image, file, website_url, _setting, _history, _current_model, enable_search, language, provider): |
|
... |
|
|
|
|
|
|
|
|
|
|
|
|
|
if __name__=="__main__": |
|
demo.queue(api_open=False, default_concurrency_limit=20)\ |
|
.launch(show_api=False, ssr_mode=True, mcp_server=False) |
|
|