Download src/generators/text/from_plan.py from pratik-250620/MultiModal-Coherence-AI: direct link, hf CLI and curl.
- Browser
- Download file 514 Bytes
-
https://huggingface.co/spaces/pratik-250620/MultiModal-Coherence-AI/resolve/main/src/generators/text/from_plan.py
- Command line
-
hf download hf://spaces/pratik-250620/MultiModal-Coherence-AI/src/generators/text/from_plan.py
-
curl -L -o from_plan.py https://huggingface.co/spaces/pratik-250620/MultiModal-Coherence-AI/resolve/main/src/generators/text/from_plan.py
514 Bytes
| from __future__ import annotations | |
| from src.planner.schema_to_text import plan_to_canonical_text | |
| from .generator import TextGenerator | |
| class PlanToText: | |
| def __init__(self): | |
| self.generator = TextGenerator() | |
| def run(self, semantic_plan) -> str: | |
| prompt = ( | |
| "Write a vivid but concise description based on the following plan:\n\n" | |
| f"{plan_to_canonical_text(semantic_plan)}\n\n" | |
| "Description:" | |
| ) | |
| return self.generator.generate(prompt).text | |