Skip to content

Commit

Permalink
pre-commit
Browse files Browse the repository at this point in the history
  • Loading branch information
daavoo committed Nov 21, 2024
1 parent 4457813 commit c73d4d3
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 11 deletions.
24 changes: 14 additions & 10 deletions demo/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 = ""
1 change: 0 additions & 1 deletion src/opennotebookllm/text_to_podcast/inference.py
Original file line number Diff line number Diff line change
@@ -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:
Expand Down

0 comments on commit c73d4d3

Please sign in to comment.