Spaces:
Sleeping
Sleeping
Claude commited on
Commit ·
ea6878f
1
Parent(s): 37d0b8b
Fix AC3: Switch from Llama 3.1 70B to Llama 3.2 3B Instruct
Browse filesLlama 3.1 70B (70 billion parameters) is too large for HuggingFace's
free Serverless Inference API (limit ~10GB). This was causing 404 errors.
Changes:
- Updated model from "meta-llama/Llama-3.1-70B-Instruct" to "meta-llama/Llama-3.2-3B-Instruct"
- Llama 3.2 3B Instruct is available for FREE on HF Inference API
- Updated documentation comments to reflect the new model
- Model is still capable of generating JSON for UI variants
This should fix the 404 errors and enable AI-powered variant generation.
agents/flutter_screen_generator.py
CHANGED
|
@@ -319,7 +319,7 @@ class FlutterScreenGenerator:
|
|
| 319 |
self.hf_token = os.getenv("HF_TOKEN", "")
|
| 320 |
# Explicitly use HF provider (not third-party like Hyperbolic)
|
| 321 |
self.client = InferenceClient(token=self.hf_token, provider="hf-inference")
|
| 322 |
-
self.model = "meta-llama/Llama-3.
|
| 323 |
|
| 324 |
# Jinja2 setup with custom delimiters (to avoid conflict with Dart ${})
|
| 325 |
template_dir = os.path.join(os.path.dirname(__file__), '..', 'templates', 'dart')
|
|
@@ -463,7 +463,7 @@ class FlutterScreenGenerator:
|
|
| 463 |
|
| 464 |
def _generate_plan(self, theme: Dict[str, Any], app_type: str, screen_type: str) -> Dict[str, Any]:
|
| 465 |
"""
|
| 466 |
-
Use Llama 3.
|
| 467 |
|
| 468 |
Returns JSON plan with sections, components, and layout decisions
|
| 469 |
"""
|
|
@@ -471,7 +471,7 @@ class FlutterScreenGenerator:
|
|
| 471 |
prompt = self._build_planning_prompt(theme, app_type, screen_type)
|
| 472 |
|
| 473 |
try:
|
| 474 |
-
# Call Llama 3.
|
| 475 |
generated_text = self.client.text_generation(
|
| 476 |
prompt=prompt,
|
| 477 |
model=self.model,
|
|
@@ -542,7 +542,7 @@ JSON Plan:"""
|
|
| 542 |
|
| 543 |
def _generate_variants_with_ai(self, theme: Dict[str, Any], app_type: str) -> list:
|
| 544 |
"""
|
| 545 |
-
Use Llama 3.
|
| 546 |
Each variant combines background + header + footer appropriately
|
| 547 |
"""
|
| 548 |
|
|
|
|
| 319 |
self.hf_token = os.getenv("HF_TOKEN", "")
|
| 320 |
# Explicitly use HF provider (not third-party like Hyperbolic)
|
| 321 |
self.client = InferenceClient(token=self.hf_token, provider="hf-inference")
|
| 322 |
+
self.model = "meta-llama/Llama-3.2-3B-Instruct" # Free tier model (70B too large for serverless API)
|
| 323 |
|
| 324 |
# Jinja2 setup with custom delimiters (to avoid conflict with Dart ${})
|
| 325 |
template_dir = os.path.join(os.path.dirname(__file__), '..', 'templates', 'dart')
|
|
|
|
| 463 |
|
| 464 |
def _generate_plan(self, theme: Dict[str, Any], app_type: str, screen_type: str) -> Dict[str, Any]:
|
| 465 |
"""
|
| 466 |
+
Use Llama 3.2 3B Instruct to generate architectural plan for the screen
|
| 467 |
|
| 468 |
Returns JSON plan with sections, components, and layout decisions
|
| 469 |
"""
|
|
|
|
| 471 |
prompt = self._build_planning_prompt(theme, app_type, screen_type)
|
| 472 |
|
| 473 |
try:
|
| 474 |
+
# Call Llama 3.2 3B Instruct via HuggingFace Inference API
|
| 475 |
generated_text = self.client.text_generation(
|
| 476 |
prompt=prompt,
|
| 477 |
model=self.model,
|
|
|
|
| 542 |
|
| 543 |
def _generate_variants_with_ai(self, theme: Dict[str, Any], app_type: str) -> list:
|
| 544 |
"""
|
| 545 |
+
Use Llama 3.2 3B Instruct to generate 4 intelligent UI variants
|
| 546 |
Each variant combines background + header + footer appropriately
|
| 547 |
"""
|
| 548 |
|