From c73d4d3dc864625fad1165ec41ee646eff201743 Mon Sep 17 00:00:00 2001 From: David de la Iglesia Castro Date: Thu, 21 Nov 2024 14:27:19 +0000 Subject: [PATCH] pre-commit --- demo/app.py | 24 +++++++++++-------- .../text_to_podcast/inference.py | 1 - 2 files changed, 14 insertions(+), 11 deletions(-) diff --git a/demo/app.py b/demo/app.py index 41ae869..58a78d8 100644 --- a/demo/app.py +++ b/demo/app.py @@ -43,26 +43,30 @@ ) clean_text = clean_text[: 4096 * 3] - model_name = st.selectbox("Select Model", + model_name = st.selectbox( + "Select Model", [ - x for x in list_repo_files(REPO) + x + for x in list_repo_files(REPO) if ".gguf" in x # The float16 is too big for the 16GB RAM codespace and "f16" not in x ], - index=None + index=None, ) if model_name: with st.spinner("Downloading and Loading Model..."): model = load_model(model_id=f"{REPO}/{model_name}") - + system_prompt = st.text_area("Podcast generation prompt", value=PODCAST_PROMPT) if st.button("Generate Podcast Script"): with st.spinner("Generating Podcast Script..."): - text = "" - for chunk in text_to_podcast(clean_text, model, system_prompt=system_prompt, stream=True): - text += chunk - if text.endswith("\n"): - st.write(text) - text = "" + text = "" + for chunk in text_to_podcast( + clean_text, model, system_prompt=system_prompt, stream=True + ): + text += chunk + if text.endswith("\n"): + st.write(text) + text = "" diff --git a/src/opennotebookllm/text_to_podcast/inference.py b/src/opennotebookllm/text_to_podcast/inference.py index 50942fc..6df3a73 100644 --- a/src/opennotebookllm/text_to_podcast/inference.py +++ b/src/opennotebookllm/text_to_podcast/inference.py @@ -1,7 +1,6 @@ from llama_cpp import Llama - def load_model( model_id: str = "allenai/OLMoE-1B-7B-0924-Instruct-GGUF/olmoe-1b-7b-0924-instruct-q8_0.gguf", ) -> Llama: