Spaces:
Sleeping
Sleeping
Download adsp/modeling/predict.py from thanhnv2323/humanize-text-python: direct link, hf CLI and curl.
- Browser
- Download file 643 Bytes
-
https://huggingface.co/spaces/thanhnv2323/humanize-text-python/resolve/main/adsp/modeling/predict.py
- Command line
-
hf download hf://spaces/thanhnv2323/humanize-text-python/adsp/modeling/predict.py
-
curl -L -o predict.py https://huggingface.co/spaces/thanhnv2323/humanize-text-python/resolve/main/adsp/modeling/predict.py
643 Bytes
| """CLI for running persona inference stub.""" | |
| from pathlib import Path | |
| import typer | |
| from adsp.config import MODELS_DIR | |
| from adsp.modeling.inference import PersonaInferenceEngine | |
| app = typer.Typer() | |
| def main( | |
| persona_id: str = "default", | |
| prompt_path: Path = Path("prompt.txt"), | |
| model_dir: Path = MODELS_DIR, | |
| ): | |
| _ = model_dir # Placeholder until a real loader is implemented | |
| engine = PersonaInferenceEngine() | |
| prompt = prompt_path.read_text(encoding="utf-8") if prompt_path.exists() else "" | |
| typer.echo(engine.generate(persona_id=persona_id, prompt=prompt)) | |
| if __name__ == "__main__": | |
| app() | |