Logo
Explore Help
Sign In
Paillat-dev/viralfactory
1
0
Fork 0
You've already forked viralfactory
mirror of https://github.com/Paillat-dev/viralfactory.git synced 2026-01-02 09:16:19 +00:00
Code Issues Packages Projects Releases Wiki Activity
Files
45a48cfa49730c2db7328c2ee7be6cc94cf9affa
viralfactory/src/utils/prompting.py

14 lines
411 B
Python
Raw Normal View History

fix(GenerationContext.py): fix typo in variable name powerfulllmengine to powerfulllmengine for better readability feat(GenerationContext.py): add setup_dir method to create a directory for output files with a timestamp feat(GenerationContext.py): call setup_dir method before generating script and synthesizing audio to ensure output directory exists feat(prompts/fix_captions.yaml): add a new prompt file to provide instructions for fixing captions fix(BaseTTSEngine.py): add force_duration method to adjust audio clip duration if it exceeds a specified duration feat(CoquiTTSEngine.py): add options for forcing duration and specifying duration in the UI feat(utils/prompting.py): add get_prompt function to load prompt files from a specified location fix(gradio_ui.py): set equal_height=True for engine_rows to ensure consistent height for engine options
2024-02-15 12:27:13 +01:00
import yaml
import os
from typing import TypedDict
class Prompt(TypedDict):
system: str
chat: str
def get_prompt(name, *, location = "src/chore/prompts") -> Prompt:
path = os.path.join(os.getcwd(), location, f"{name}.yaml")
if not os.path.exists(path):
raise FileNotFoundError(f"Prompt file {path} does not exist.")
with open(path, "r") as file:
return yaml.safe_load(file)
Reference in New Issue Copy Permalink
Powered by Gitea Version: 1.25.3 Page: 23ms Template: 2ms
English
Bahasa Indonesia Deutsch English Español Français Gaeilge Italiano Latviešu Magyar nyelv Nederlands Polski Português de Portugal Português do Brasil Suomi Svenska Türkçe Čeština Ελληνικά Български Русский Українська فارسی മലയാളം 日本語 简体中文 繁體中文(台灣) 繁體中文(香港) 한국어
Licenses API