Skip to content

Commit

Permalink
f
Browse files Browse the repository at this point in the history
  • Loading branch information
rmusser01 committed Jan 3, 2025
1 parent ce8e80d commit 0f1b3f6
Show file tree
Hide file tree
Showing 11 changed files with 156 additions and 37 deletions.
61 changes: 61 additions & 0 deletions App_Function_Libraries/TTS/TTS_Providers.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,20 @@ def generate_audio(api_key, text, provider, voice=None, model=None, voice2=None,
model=model
)

elif provider == "google":
pass

elif provider == "gpt-soviTTS":
pass

elif provider == "piper":
logging.info("Using Piper TTS provider")
return generate_audio_piper(
input_text=text,
model=model,
output_file=output_file,
)

else:
error_msg = f"Invalid TTS provider: {provider}"
logging.error(error_msg)
Expand Down Expand Up @@ -664,6 +678,53 @@ def test_generate_audio_alltalk():
#######################################################


#######################################################
#
# Piper TTS Provider Functions
# https://github.com/rhasspy/piper
# https://github.com/erew123/alltalk_tts/wiki/API-%E2%80%90-OpenAI-V1-Speech-Compatible-Endpoint

def generate_audio_piper(input_text, voice=None, model=None, response_format=None, speed=None):
"""Generate audio using Piper TTS.
Args:
Returns:
str: Path to the generated audio file
"""

# Input validation
pass

#
# End of Piper TTS Provider Functions
#######################################################


#######################################################
#
# Vevo TTS Provider Functions
#
# https://github.com/open-mmlab/Amphion
# https://huggingface.co/amphion/Vevo

def generate_audio_piper(input_text, voice=None, model=None, response_format=None, speed=None):
"""Generate audio using Piper TTS.
Args:
Returns:
str: Path to the generated audio file
"""

# Input validation
pass

#
# End of Piper TTS Provider Functions
#######################################################


#######################################################
#
# gpt-soviTTS TTS Provider Functions
Expand Down
11 changes: 10 additions & 1 deletion App_Function_Libraries/Utils/Utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -460,6 +460,10 @@ def load_and_log_configs():
yandex_search_api_key = config.get('Search-Engines', 'search_engine_api_key_yandex', fallback='')
yandex_search_engine_id = config.get('Search-Engines', 'search_engine_id_yandex', fallback='')

# Prompts
sub_question_generation_prompt = config.get('Prompts', 'sub_question_generation_prompt', fallback='')
search_result_relevance_eval_prompt = config.get('Prompts', 'search_result_relevance_eval_prompt', fallback='')
analyze_search_results_prompt = config.get('Prompts', 'analyze_search_results_prompt', fallback='')

return {
'anthropic_api': {
Expand Down Expand Up @@ -695,7 +699,12 @@ def load_and_log_configs():
'tavily_search_api_key': tavily_search_api_key,
'yandex_search_api_key': yandex_search_api_key,
'yandex_search_engine_id': yandex_search_engine_id
}
},
'prompts': {
'sub_question_generation_prompt': sub_question_generation_prompt,
'search_result_relevance_eval_prompt': search_result_relevance_eval_prompt,
'analyze_search_results_prompt': analyze_search_results_prompt,
},
}

except Exception as e:
Expand Down
9 changes: 7 additions & 2 deletions App_Function_Libraries/Web_Scraping/WebSearch_APIs.py
Original file line number Diff line number Diff line change
Expand Up @@ -478,6 +478,7 @@ def aggregate_results(
- evidence (List[Dict]): List of relevant content items included in the summary.
- confidence (float): A rough confidence score (placeholder).
"""
logging.info("Aggregating and summarizing relevant results")
if not relevant_results:
return {
"Report": "No relevant results found. Unable to provide an answer.",
Expand All @@ -493,7 +494,6 @@ def aggregate_results(
)

# Example analysis prompt
# FIXME - Add to config.txt/utils.py
analyze_search_results_prompt = f"""
Generate a comprehensive, well-structured, and informative answer for a given question,
using ONLY the information found in the provided web Search Results (URL, Page Title, Summary).
Expand Down Expand Up @@ -535,13 +535,17 @@ def aggregate_results(
input_data = "Follow the above instructions."

try:
logging.info("Generating the report")
returned_response = chat_api_call(
api_endpoint=api_endpoint,
api_key=None,
input_data=input_data,
prompt=analyze_search_results_prompt,
temp=0.7
temp=0.7,
system_message=None,
streaming=False
)
logging.debug(f"Returned response from LLM: {returned_response}")
if returned_response:
# You could do further parsing or confidence estimation here
return {
Expand All @@ -552,6 +556,7 @@ def aggregate_results(
except Exception as e:
logging.error(f"Error aggregating results: {e}")

logging.error("Could not create the report due to an error.")
return {
"summary": "Could not create the report due to an error.",
"evidence": list(relevant_results.values()),
Expand Down
2 changes: 2 additions & 0 deletions Docs/Design/Diagram_Generation.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
### Link Dump:
https://excalidraw.com/
https://www.napkin.ai/
https://github.com/southbridgeai/diagen




2 changes: 2 additions & 0 deletions Docs/Design/Researcher.md
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,8 @@ Gemini Deepresearcher
https://github.com/assafelovic/gpt-researcher
https://arxiv.org/abs/2411.15114

https://github.com/binary-husky/gpt_academic/blob/master/docs/README.English.md
https://arxiv.org/abs/2409.13741
https://github.com/assafelovic/gpt-researcher/tree/master/gpt_researcher

https://github.com/neuml/annotateai
Expand Down
4 changes: 4 additions & 0 deletions Docs/Design/Structured_Outputs.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Structured Outputs


https://towardsdatascience.com/diving-deeper-with-structured-outputs-b4a5d280c208


## Introduction
This page serves as documentation regarding the structured outputs within tldw and provides context/justification for the decisions made within the module.

Expand Down
1 change: 1 addition & 0 deletions Docs/Design/Summarization.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,5 @@ https://neptune.ai/blog/llm-evaluation-text-summarization
https://phoenix.arize.com/llm-summarization-getting-to-production/
https://blog.metrostar.com/iteratively-summarize-long-documents-llm
https://arxiv.org/html/2412.15487v1
https://arxiv.org/pdf/2204.01849

14 changes: 10 additions & 4 deletions Docs/Design/TTS_STT.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,6 @@ https://github.com/albirrkarim/react-speech-highlight-demo
https://funaudiollm.github.io/cosyvoice2/
https://funaudiollm.github.io/cosyvoice2/
https://github.com/InternLM/InternLM-XComposer/tree/main/InternLM-XComposer-2.5-OmniLive
https://github.com/huggingface/transformers.js-examples/tree/main/moonshine-web
https://huggingface.co/onnx-community/moonshine-base-ONNX
https://github.com/usefulsensors/moonshine
https://github.com/Azure-Samples/aisearch-openai-rag-audio
https://www.reddit.com/r/LocalLLaMA/comments/1f0awd6/best_local_open_source_texttospeech_and/
https://github.com/FanaHOVA/smol-podcaster
Expand All @@ -47,18 +44,25 @@ https://huggingface.co/spaces/mozilla-ai/document-to-podcast/blob/main/app.py
https://huggingface.co/spaces/Nymbo/Voice-Clone-Multilingual/tree/main
https://github.com/aedocw/epub2tts
https://github.com/microsoft/SpeechT5
https://www.lightnote.co/?utm_source=www.hivefive.community&utm_medium=newsletter&utm_campaign=hive-five-202-a-bias-to-action
https://github.com/smellslikeml/dolla_llama

https://github.com/dnhkng/GlaDOS

STT
https://github.com/KoljaB/RealtimeSTT
https://github.com/southbridgeai/offmute
MoonShine
https://github.com/usefulsensors/moonshine
https://github.com/huggingface/transformers.js-examples/tree/main/moonshine-web
https://huggingface.co/onnx-community/moonshine-base-ONNX

TTS
https://github.com/KoljaB/RealtimeTTS

101
https://www.inferless.com/learn/comparing-different-text-to-speech---tts--models-for-different-use-cases
https://clideo.com/resources/what-is-tts
https://pub.towardsai.net/the-ultimate-guide-to-audio-processing-principles-techniques-and-applications-7724efea00e8
RVC 101
https://gudgud96.github.io/2024/09/26/annotated-rvc/

Expand Down Expand Up @@ -130,6 +134,8 @@ MaskGCT
Parler
https://github.com/huggingface/parler-tts

Sherpa ONNX
https://github.com/k2-fsa/sherpa-onnx

YourTTS
https://github.com/Edresson/YourTTS
Expand Down
3 changes: 3 additions & 0 deletions Docs/Design/UX.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,9 @@ https://markwhen.com/
https://kando.menu/
https://deepseek-artifacts.vercel.app/

Not waifus, but clippy:
https://github.com/fghrsh/live2d_demo


Prompt Engineering page:
- 3 Sections
Expand Down
85 changes: 55 additions & 30 deletions Docs/Issues/Citations_and_Confabulations.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,21 @@
3. [References](#references)



https://arxiv.org/abs/2412.04235
https://arxiv.org/abs/2412.11536
https://github.com/sunnynexus/RetroLLM
https://huggingface.co/PleIAs/Pleias-Nano
https://deepmind.google/discover/blog/facts-grounding-a-new-benchmark-for-evaluating-the-factuality-of-large-language-models/
https://arxiv.org/abs/2412.14860
https://arxiv.org/abs/2412.14686
https://arxiv.org/abs/2412.18069



RAG
https://www.lycee.ai/blog/rag-ragallucinations-and-how-to-fight-them
https://huggingface.co/PleIAs/Pleias-Nano
https://arxiv.org/abs/2412.11536
https://cloud.google.com/generative-ai-app-builder/docs/check-grounding
https://cloud.google.com/generative-ai-app-builder/docs/grounded-gen
https://arxiv.org/html/2412.15189v1#S6
https://aclanthology.org/2024.fever-1.10/
https://arxiv.org/pdf/2412.15189
https://huggingface.co/papers/2408.12060
https://primer.ai/research/rag-v-divide-and-conquer-with-factual-claims/
https://arxiv.org/abs/2411.06037
https://www.sciencedirect.com/science/article/abs/pii/S0306457320309675
https://github.com/Huffon/factsumm
https://arxiv.org/abs/2410.07176

Finetuning:
- https://eugeneyan.com/writing/finetuning/
Expand All @@ -30,8 +31,12 @@ Finetuning:
- **101**
- Unsorted
- https://mattyyeung.github.io/deterministic-quoting#7-conclusion-is-this-really-ready-for-healthcare
https://github.com/sunnynexus/RetroLLM
- https://github.com/MadryLab/context-cite


Abstractive Proposition Segmentation
https://arxiv.org/abs/2406.19803
https://huggingface.co/google/gemma-2b-aps-it

Anthropic:
```
Expand Down Expand Up @@ -71,6 +76,12 @@ Benchmarks
https://huggingface.co/spaces/vectara/Hallucination-evaluation-leaderboard
https://huggingface.co/spaces/hallucinations-leaderboard/leaderboard
https://osu-nlp-group.github.io/AttributionBench/
Fake News
https://arxiv.org/abs/2412.14686
FACTS
https://www.kaggle.com/facts-leaderboard
https://storage.googleapis.com/deepmind-media/FACTS/FACTS_grounding_paper.pdf
https://deepmind.google/discover/blog/facts-grounding-a-new-benchmark-for-evaluating-the-factuality-of-large-language-models/


Detecting Hallucinations using Semantic Entropy:
Expand All @@ -93,38 +104,52 @@ Explainability

Research
https://github.com/EdinburghNLP/awesome-hallucination-detection
https://arxiv.org/abs/2407.13481
https://arxiv.org/abs/2408.06195
https://arxiv.org/abs/2407.19813
https://www.lycee.ai/blog/rag-ragallucinations-and-how-to-fight-them
https://arxiv.org/abs/2407.16557
https://arxiv.org/abs/2407.16604
https://arxiv.org/pdf/2309.11495
https://deepmind.google/research/publications/85420/
https://thetechoasis.beehiiv.com/p/eliminating-hallucinations-robots-imitate-us
https://arxiv.org/abs/2407.19825
https://arxiv.org/abs/2411.14257
https://arxiv.org/pdf/2406.02543
https://arxiv.org/pdf/2410.19385
https://arxiv.org/abs/2406.10279
https://arxiv.org/abs/2402.17811
https://arxiv.org/pdf/2409.18475
https://llm-editing.github.io/
https://arxiv.org/abs/2411.14257
https://arxiv.org/pdf/2407.03651
https://cleanlab.ai/blog/trustworthy-language-model/
https://arxiv.org/abs/2408.07852
General
https://arxiv.org/pdf/2410.19385
https://arxiv.org/pdf/2409.18475
https://arxiv.org/pdf/2406.02543
https://arxiv.org/abs/2407.19825
https://arxiv.org/abs/2407.16604
https://arxiv.org/abs/2407.16557
https://arxiv.org/abs/2412.04235
Attention/Long Context
https://arxiv.org/abs/2407.13481
https://arxiv.org/pdf/2407.03651
CoV
https://arxiv.org/pdf/2309.11495
KnowledgeGraph
https://arxiv.org/abs/2408.07852
Mutual Reasoning
https://arxiv.org/abs/2408.06195
Self-Reasoning
https://arxiv.org/abs/2407.19813
https://arxiv.org/abs/2412.14860
Detecting Hallucinations
https://arxiv.org/abs/2410.22071
https://arxiv.org/abs/2410.02707
https://arxiv.org/abs/2411.14257
Reflective thinking
https://arxiv.org/html/2404.09129v1
https://github.com/yanhong-lbh/LLM-SelfReflection-Eval
Semantic Entropy
https://www.nature.com/articles/s41586-024-07421-0
https://arxiv.org/abs/2406.15927
Software Packages
https://arxiv.org/abs/2406.10279
TruthX
https://arxiv.org/abs/2402.17811
Working memory
https://arxiv.org/abs/2412.18069
HALVA
https://research.google/blog/halva-hallucination-attenuated-language-and-vision-assistant/
Long Form Factuality - Google
https://github.com/google-deepmind/long-form-factuality
https://deepmind.google/research/publications/85420/



LLM As Judge:
Expand Down
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ openai
#outlines
pandas
Pillow
#piper-tts
playwright
# I'm not using postgres yet...
#psycopg2
Expand Down

0 comments on commit 0f1b3f6

Please sign in to comment.