update glm 4.7
Browse filesFiles changed (6)
97 unmodified lines989910010110210310485 unmodified lines19019119219319419519697 unmodified lines# Define models and languages here to avoid importing Gradio UIAVAILABLE_MODELS = [{"name": "GLM-4.6", "id": "zai-org/GLM-4.6", "description": "GLM-4.6 model via HuggingFace with Cerebras provider (Default)", "supports_images": False},{"name": "GLM-4.6V 👁️", "id": "zai-org/GLM-4.6V:zai-org", "description": "GLM-4.6V vision model - supports image uploads for visual understanding", "supports_images": True},{"name": "DeepSeek V3", "id": "deepseek-ai/DeepSeek-V3", "description": "DeepSeek V3 - Fast model for code generation via HuggingFace Router with Novita provider", "supports_images": False},{"name": "DeepSeek R1", "id": "deepseek-ai/DeepSeek-R1", "description": "DeepSeek R1 model for code generation via HuggingFace", "supports_images": False},85 unmodified linesclass CodeGenerationRequest(BaseModel):query: strlanguage: str = "html"model_id: str = "zai-org/GLM-4.6"provider: str = "auto"history: List[List[str]] = []agent_mode: bool = False97 unmodified lines989910010110210310410585 unmodified lines19119219319419519619797 unmodified lines# Define models and languages here to avoid importing Gradio UIAVAILABLE_MODELS = [{"name": "GLM-4.7", "id": "zai-org/GLM-4.7", "description": "GLM-4.7 - Latest GLM model via HuggingFace (Default)", "supports_images": False},{"name": "GLM-4.6", "id": "zai-org/GLM-4.6", "description": "GLM-4.6 model via HuggingFace with Cerebras provider", "supports_images": False},{"name": "GLM-4.6V 👁️", "id": "zai-org/GLM-4.6V:zai-org", "description": "GLM-4.6V vision model - supports image uploads for visual understanding", "supports_images": True},{"name": "DeepSeek V3", "id": "deepseek-ai/DeepSeek-V3", "description": "DeepSeek V3 - Fast model for code generation via HuggingFace Router with Novita provider", "supports_images": False},{"name": "DeepSeek R1", "id": "deepseek-ai/DeepSeek-R1", "description": "DeepSeek R1 model for code generation via HuggingFace", "supports_images": False},85 unmodified linesclass CodeGenerationRequest(BaseModel):query: strlanguage: str = "html"model_id: str = "zai-org/GLM-4.7"provider: str = "auto"history: List[List[str]] = []agent_mode: bool = False
94 unmodified lines959697989910094 unmodified lines# GLM-4.5 needs fireworks-ai providerreturn "zai-org/GLM-4.5:fireworks-ai"return model_id94 unmodified lines959697989910010110210310494 unmodified lines# GLM-4.5 needs fireworks-ai providerreturn "zai-org/GLM-4.5:fireworks-ai"elif model_id == "zai-org/GLM-4.7":# GLM-4.7 needs zai-org provider suffixreturn "zai-org/GLM-4.7:zai-org"return model_id
370 unmodified lines371372373374375376377378370 unmodified lines# Use a lightweight model for this tasktry:client = get_inference_client("zai-org/GLM-4.6", "auto")actual_model_id = get_real_model_id("zai-org/GLM-4.6")imports_text = '\n'.join(import_statements)370 unmodified lines371372373374375376377378370 unmodified lines# Use a lightweight model for this tasktry:client = get_inference_client("zai-org/GLM-4.7", "auto")actual_model_id = get_real_model_id("zai-org/GLM-4.7")imports_text = '\n'.join(import_statements)
16 unmodified lines1718192021222316 unmodified linesconst [generatedCode, setGeneratedCode] = useState('');const [selectedLanguage, setSelectedLanguage] = useState<Language>('html');const [selectedModel, setSelectedModel] = useState('zai-org/GLM-4.6');const [models, setModels] = useState<Model[]>([]);const [isGenerating, setIsGenerating] = useState(false);const [isAuthenticated, setIsAuthenticated] = useState(false);16 unmodified lines1718192021222316 unmodified linesconst [generatedCode, setGeneratedCode] = useState('');const [selectedLanguage, setSelectedLanguage] = useState<Language>('html');const [selectedModel, setSelectedModel] = useState('zai-org/GLM-4.7');const [models, setModels] = useState<Model[]>([]);const [isGenerating, setIsGenerating] = useState(false);const [isAuthenticated, setIsAuthenticated] = useState(false);
195 unmodified lines196197198199200201202195 unmodified lines><div className="flex items-center justify-between gap-2"><span className="text-sm text-[#f5f5f7]">{model.name}</span>{model.id === 'zai-org/GLM-4.6' && (<span className="px-1.5 py-0.5 bg-gradient-to-r from-purple-500 to-pink-500 text-white text-[9px] font-bold rounded uppercase flex-shrink-0">NEW</span>195 unmodified lines196197198199200201202195 unmodified lines><div className="flex items-center justify-between gap-2"><span className="text-sm text-[#f5f5f7]">{model.name}</span>{model.id === 'zai-org/GLM-4.7' && (<span className="px-1.5 py-0.5 bg-gradient-to-r from-purple-500 to-pink-500 text-white text-[9px] font-bold rounded uppercase flex-shrink-0">NEW</span>
30 unmodified lines31323334353637475 unmodified lines51351451551651751851952037 unmodified lines558559560561562563564565267 unmodified lines83383483583683783883930 unmodified linesonImport,isAuthenticated,initialLanguage = 'html',initialModel = 'zai-org/GLM-4.6',onAuthChange,setPendingPR,pendingPRRef475 unmodified linesif (onStart) {// Pass duplicated space ID so auto-deploy updates itconsole.log('[Redesign] Calling onStart with duplicated repo ID:', duplicatedRepoId);console.log('[Redesign] Using GLM-4.6 for redesign');onStart(redesignPrompt, result.language || 'html', 'zai-org/GLM-4.6', undefined, duplicatedRepoId);}}, 100);37 unmodified linesif (onStart) {console.log('[Redesign] Will create PR - not passing repo ID');console.log('[Redesign] Using GLM-4.6 for redesign');onStart(redesignPrompt, result.language || 'html', 'zai-org/GLM-4.6', undefined, repoId, true); // Pass true for shouldCreatePR}console.log('[Redesign] Will create PR after code generation completes');267 unmodified lines><div className="flex items-center justify-between gap-2"><span className="text-xs font-medium text-[#f5f5f7]">{model.name}</span>{model.id === 'zai-org/GLM-4.6' && (<span className="px-1.5 py-0.5 bg-gradient-to-r from-purple-500 to-pink-500 text-white text-[9px] font-bold rounded uppercase">NEW</span>30 unmodified lines31323334353637475 unmodified lines51351451551651751851952037 unmodified lines558559560561562563564565267 unmodified lines83383483583683783883930 unmodified linesonImport,isAuthenticated,initialLanguage = 'html',initialModel = 'zai-org/GLM-4.7',onAuthChange,setPendingPR,pendingPRRef475 unmodified linesif (onStart) {// Pass duplicated space ID so auto-deploy updates itconsole.log('[Redesign] Calling onStart with duplicated repo ID:', duplicatedRepoId);console.log('[Redesign] Using GLM-4.7 for redesign');onStart(redesignPrompt, result.language || 'html', 'zai-org/GLM-4.7', undefined, duplicatedRepoId);}}, 100);37 unmodified linesif (onStart) {console.log('[Redesign] Will create PR - not passing repo ID');console.log('[Redesign] Using GLM-4.7 for redesign');onStart(redesignPrompt, result.language || 'html', 'zai-org/GLM-4.7', undefined, repoId, true); // Pass true for shouldCreatePR}console.log('[Redesign] Will create PR after code generation completes');267 unmodified lines><div className="flex items-center justify-between gap-2"><span className="text-xs font-medium text-[#f5f5f7]">{model.name}</span>{model.id === 'zai-org/GLM-4.7' && (<span className="px-1.5 py-0.5 bg-gradient-to-r from-purple-500 to-pink-500 text-white text-[9px] font-bold rounded uppercase">NEW</span>
backend_api.py+3-2
backend_models.py+4
backend_parsers.py+2-2
frontend/src/app/page.tsx+1-1
frontend/src/components/ControlPanel.tsx+1-1
frontend/src/components/LandingPage.tsx+6-6