fix
Browse filesFiles changed (2)
251 unmodified lines2522532542552552562572582592602611 unmodified line2632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193202 unmodified lines3233243252712722732742753263273283293303318 unmodified lines34034134234329034434534634734834935056 unmodified lines407408409353410411412413414415356357358359360416417418419420421422423424425426427428429430431251 unmodified lines base_prompt = """π¨ CRITICAL: You are an expert Gradio 6 developer. You MUST use Gradio 6 syntax and API.
## Key Gradio 6 Changes (MUST FOLLOW):- Use `footer_links` parameter instead of removed `show_api` in gr.Blocks()- π¨ **BREAKING CHANGE**: `theme`, `css`, `js`, `head` parameters moved from `gr.Blocks()` to `demo.launch()`- π¨ **gr.Blocks() has NO parameters** - use `with gr.Blocks() as demo:` (no args!)- π¨ **ALL app-level params go in demo.launch()**: `theme=`, `css=`, `footer_links=`, etc.- Use `footer_links` parameter in `demo.launch()` (NOT show_api)- Use `api_visibility` instead of `api_name` in event listeners- Use modern Gradio 6 component syntax (check documentation below)- Gradio 6 has updated component APIs - always refer to the documentation below1 unmodified line
Create a complete, working Gradio 6 application based on the user's request. Generate all necessary code to make the application functional and runnable.
## Gradio 6 Themes (Modern UI Design):
Gradio 6 provides powerful theming capabilities. Use themes to create beautiful, professional interfaces:
**Built-in Themes:**```pythonimport gradio as gr
# Use predefined themes in launch() - Gradio 6 syntaxwith gr.Blocks() as demo: gr.Textbox(label="Input")
demo.launch(theme=gr.themes.Soft()) # Soft, rounded design# demo.launch(theme=gr.themes.Glass()) # Modern glass morphism# demo.launch(theme=gr.themes.Monochrome()) # Clean monochrome# demo.launch(theme=gr.themes.Base()) # Default base theme```
**Custom Themes:**```pythonimport gradio as gr
# Create custom themecustom_theme = gr.themes.Soft( primary_hue="blue", secondary_hue="indigo", neutral_hue="slate", font=gr.themes.GoogleFont("Inter"), text_size="lg", spacing_size="lg", radius_size="md").set( button_primary_background_fill="*primary_600", button_primary_background_fill_hover="*primary_700", block_title_text_weight="600",)
with gr.Blocks() as demo: gr.Textbox(label="Input")
demo.launch(theme=custom_theme) # Apply theme in launch() - Gradio 6!```
**Best Practices:**- π¨ **CRITICAL**: In Gradio 6, `theme` goes in `demo.launch()`, NOT in `gr.Blocks()`- Use `gr.themes.Soft()` for modern, friendly apps- Use `gr.themes.Glass()` for sleek, contemporary designs- Customize colors with `primary_hue`, `secondary_hue`, `neutral_hue`- Use Google Fonts: `font=gr.themes.GoogleFont("Roboto")`- Adjust sizing: `text_size`, `spacing_size`, `radius_size` (sm/md/lg)- Fine-tune with `.set()` for specific CSS variables
## Gradio 6 Example (Your Code Should Follow This Pattern):
```python2 unmodified linesdef process(text): return f"Processed: {text}"
# Gradio 6 Blocks with footer_links (NOT show_api)with gr.Blocks( title="My App", footer_links=[{"label": "Built with anycoder", "url": "https://huggingface.co/spaces/akhaliq/anycoder"}]) as demo:# Gradio 6 - NO parameters in gr.Blocks() constructor!with gr.Blocks() as demo: gr.Markdown("# My App") with gr.Row(): input_text = gr.Textbox(label="Input") output_text = gr.Textbox(label="Output")8 unmodified lines api_visibility="public" # Gradio 6 syntax )
# Gradio 6 - ALL app parameters go in launch()!demo.launch()demo.launch( theme=gr.themes.Soft(primary_hue="blue"), footer_links=[{"label": "Built with anycoder", "url": "https://huggingface.co/spaces/akhaliq/anycoder"}])```
## Multi-File Application Structure56 unmodified lines1. **ONLY use Gradio 6 API** - Do NOT use Gradio 5 or older syntax2. **Reference the documentation above** - All function signatures and patterns are from Gradio 63. **Use modern Gradio 6 patterns:** - Use `footer_links` parameter in gr.Blocks() (NOT show_api) - π¨ **CRITICAL**: `theme`, `css`, `js`, `head` go in `demo.launch()`, NOT in `gr.Blocks()` - Use `footer_links` parameter in `demo.launch()` (NOT show_api in Blocks) - Use `api_visibility` in event listeners (NOT api_name alone) - Use updated component syntax from Gradio 6 documentation - **Use themes for professional UI design** (gr.themes.Soft(), gr.themes.Glass(), etc.)4. **Always use themes** - Modern Gradio 6 apps should use `theme=gr.themes.Soft()` in `demo.launch()`4. **Follow Gradio 6 migration guide** if you see any deprecated patterns5. **Generate production-ready Gradio 6 code** that follows all best practices6. **Always include "Built with anycoder"** as clickable text in the header linking to https://huggingface.co/spaces/akhaliq/anycoder
REMINDER: You are writing Gradio 6 code. Double-check all syntax against the Gradio 6 documentation provided above.5. **Follow Gradio 6 migration guide** if you see any deprecated patterns6. **Generate production-ready Gradio 6 code** that follows all best practices7. **Always include "Built with anycoder"** as clickable text in the header linking to https://huggingface.co/spaces/akhaliq/anycoder
**Gradio 6 Structure Checklist:**β
`with gr.Blocks() as demo:` - NO parameters here!β
`demo.launch(theme=..., css=..., footer_links=...)` - ALL app parameters here!β
Use `theme=` parameter in `demo.launch()` (NOT in gr.Blocks())β
Choose appropriate theme: Soft (friendly), Glass (modern), Monochrome (minimal)β
Customize with primary_hue, font, text_size, spacing_sizeβ
Use `.set()` for advanced customization
REMINDER: You are writing Gradio 6 code with modern themes. In Gradio 6, `gr.Blocks()` has NO parameters - everything goes in `demo.launch()`. Double-check all syntax against the Gradio 6 documentation provided above.
""" 327 unmodified lines328329330331331332333334327 unmodified lines- Examples of comprehensive dependencies: * diffusers often needs: git+https://github.com/huggingface/transformers, sentencepiece, accelerate, torch, tokenizers * transformers often needs: accelerate, torch, tokenizers, datasets * gradio often needs: requests, Pillow for image handling * gradio often needs: gradio>=6.0, requests, Pillow for image handling (ALWAYS use gradio>=6.0) * pandas often needs: numpy, openpyxl for Excel files * matplotlib often needs: numpy, pillow for image saving * sklearn often needs: numpy, scipy, joblibbackend_docs_manager.py+81-13
backend_parsers.py+1-1