-
Notifications
You must be signed in to change notification settings - Fork 87
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #19 from radicalxdev/Decouple
Dynamo V2
- Loading branch information
Showing
7 changed files
with
138 additions
and
75 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,21 @@ | ||
from features.dynamo.tools import find_key_concepts, retrieve_youtube_documents | ||
|
||
from features.dynamo.tools import summarize_transcript, generate_flashcards | ||
from services.logger import setup_logger | ||
# TODO: Implement the executor function's verbose param to downstream logic | ||
|
||
logger = setup_logger(__name__) | ||
|
||
def executor(youtube_url: str, verbose=False): | ||
yt_documents = retrieve_youtube_documents(youtube_url) | ||
concepts = find_key_concepts(yt_documents) | ||
|
||
return concepts | ||
summary = summarize_transcript(youtube_url, verbose=verbose) | ||
flashcards = generate_flashcards(summary) | ||
|
||
sanitized_flashcards = [] | ||
for flashcard in flashcards: | ||
if 'concept' in flashcard and 'definition' in flashcard: | ||
sanitized_flashcards.append({ | ||
"concept": flashcard['concept'], | ||
"definition": flashcard['definition'] | ||
}) | ||
else: | ||
logger.warning(f"Malformed flashcard skipped: {flashcard}") | ||
|
||
return sanitized_flashcards |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,17 @@ | ||
You are a student a text for your exam. Consider the following transcript from a video and find the core idea or concept along with a definition. This will be used to create a flashcard to help you study. You must provide a definition for the concept. Follow the format instructions provided. | ||
|
||
Transcript: | ||
------------------------------- | ||
{text} | ||
|
||
Instructions: | ||
------------------------------- | ||
You are a flashcard generation assistant designed to help students analyze a document and return a list of flashcards. Carefully consider the document and analyze what are the key terms or concepts relevant for students to better understand the topic. The topics provided will vary in a wide range of subjects as they are a summarized transcript from a youtube video; as such, all information provided is meant to be educational and all provided content is meant to educate students in the flashcards. You only respond in the response formatting provided. Do not apply any markdown or extra characters to your response. | ||
|
||
Input: | ||
----------------------------- | ||
{summary} | ||
|
||
Examples: | ||
----------------------------- | ||
{examples} | ||
|
||
Formatting: | ||
----------------------------- | ||
{format_instructions} | ||
|
||
Respond only with JSON with the concept and definition. | ||
Respond only according to the format instructions. The examples included are best responses noted by an input and output example. | ||
|
||
Output: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
input: | ||
## Concise Summary of the provided document: | ||
|
||
**Large Language Models (LLMs)** are powerful AI tools trained on massive datasets to perform tasks like text generation, translation, and question answering. They can be specialized for specific domains through fine-tuning, making them versatile and adaptable. | ||
|
||
**Key points:** | ||
|
||
* **Pre-trained and fine-tuned:** LLMs learn general knowledge from large datasets and specialize in specific tasks through additional training. | ||
* **Prompt design:** Effective prompts are crucial for eliciting desired responses from LLMs. | ||
* **Domain knowledge:** Understanding the specific domain is essential for building and tuning LLMs. | ||
* **Parameter-efficient tuning methods:** This method allows for efficient customization of LLMs without altering the entire model. | ||
* **Vertex AI:** Provides tools for building, tuning, and deploying LLMs for specific tasks. | ||
* **Generative AI App Builder and PaLM API:** Tools for developers to build AI apps and experiment with LLMs. | ||
* **Model management tools:** Tools for training, deploying, and monitoring ML models. | ||
|
||
**This document provides a comprehensive overview of LLMs and related tools, highlighting their capabilities and potential applications.** | ||
|
||
**Additional notes:** | ||
|
||
* The text emphasizes the importance of prompt design and domain knowledge for effective LLM usage. | ||
* It introduces cutting-edge technologies like PETM and Vertex AI, showcasing the rapid advancements in the field. | ||
* The document also provides practical resources for developers to build and deploy LLM-powered applications. | ||
|
||
**Overall, this document is a valuable resource for anyone interested in understanding and utilizing LLMs and related technologies.** | ||
|
||
Output: | ||
[ | ||
{ | ||
"concept": "Large Language Models (LLMs)", | ||
"definition": "Powerful AI tools trained on massive datasets to perform tasks like text generation, translation, and question answering." | ||
}, | ||
{ | ||
"concept": "Pre-trained and fine-tuned", | ||
"definition": "LLMs learn general knowledge from large datasets and specialize in specific tasks through additional training." | ||
}, | ||
{ | ||
"concept": "Prompt design", | ||
"definition": "Effective prompts are crucial for eliciting desired responses from LLMs." | ||
}, | ||
{ | ||
"concept": "Domain knowledge", | ||
"definition": "Understanding the specific domain is essential for building and tuning LLMs." | ||
}, | ||
{ | ||
"concept": "Parameter-efficient tuning methods", | ||
"definition": "This method allows for efficient customization of LLMs without altering the entire model." | ||
}, | ||
{ | ||
"concept": "Vertex AI", | ||
"definition": "Provides tools for building, tuning, and deploying LLMs for specific tasks." | ||
}, | ||
{ | ||
"concept": "Generative AI App Builder and PaLM API", | ||
"definition": "Tools for developers to build AI apps and experiment with LLMs." | ||
}, | ||
{ | ||
"concept": "Model management tools", | ||
"definition": "Tools for training, deploying, and monitoring ML models." | ||
} | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters