Open jmikedupont2 opened 1 year ago
Okay, so let's do a minimal viable product for this workflow that will basically take, we have the globals that we've extracted in Python, and I've sent them to clarify. We have redacted all of the keys from the memory, so there's no keys exposed. And now, basically, I've loaded this in, and we're going to associate with a workflow, and that workflow, we're going to have it compare all of the items with each other. So we're going to pair up all the items in an 8th-dimensional Cartesian join, and we're going to relate them all to each other.
Here is one approach to creating a rewrite rule from the wiki page content to a workflow:
workflow:
- AddStarTask
- RollDiceTask: {dimensions: 1}
- AddPersonaTask
- RollDiceTask: {dimensions: 2}
- AddSymbolTasks: {symbols: [shield, book, dancer, music, comedy, script]}
- RollDiceTask: {dimensions: 3}
- PermuteTasks: {depth: 1}
- RollDiceTask: {dimensions: 4}
- AddSymbolTasks: {symbols: [element]}
- RollDiceTask: {dimensions: 5}
This maps the key conceptual steps into an executable workflow definition. The wiki lines can be parsed and input into the workflow, generating an output that transforms the conceptual instructions into a programmatic process. Let me know if you would like me to clarify or expand on any part of this proposed rewrite rule.
@jmikedupont2 Does Clarifai provide dev environment for building out a custom LLaMA 2 model? I wanna use libs likeaccelerate
, bitsandbytes
?
Or can we deploy docker images?
I want to:
I would like to tell you about me new introspector project software that I am using to bootstrap my clarifi hackathon. @everyone I wanted to share an update on our Llama 2 hackathon project design process. We're documenting and tracking our project workflow and technical design in this GitHub issue:
This issue thread will be used to outline our overall workflow, sketch concepts, track tasks, and get feedback. We'll be posting our user stories, wireframes, data models, and other key design docs here as we iterate.
Please feel free to review the issue and add any comments or suggestions! We want this to be collaborative. Let's use this issue as a central place to organize the project design as we build out the Llama 2 hackathon submission. Tagged relevant folks below who may want to follow along.
We're excited to take this community-driven approach to keep everything open and transparent as we progress. Please subscribe and contribute however you can!
What are the memory reqs? It appears it can be squeezed onto my server with 12gb https://github.com/huggingface/text-generation-inference/issues/757
Here are some key steps I would take to translate the Clarifai Help Center documentation on models and workflows into code for an automated workflow:
Extract the key concepts and tasks described in the text into a list:
Map each concept/task to a module or function:
create_workflow()
: Takes model IDs and versions, returns workflow objectpredict_workflow()
: Takes workflow ID and inputs, returns predictionsget_workflows()
: Returns list of workflowsupdate_workflow()
: Patches workflow with new modelsdelete_workflow()
: Deletes a workflowDefine the parameters needed for each function based on the docs:
Create skeleton code for the modules and functions
Implement utils like authentication, error handling
Build out the function logic referencing the docs
Test the functions with sample data
Connect into an end-to-end workflow script
This gives a good starter workflow covering the key concepts that can be refined and built upon incrementally based on the docs. Let me know if any part needs more clarification!
Got it, it sounds like you're looking to create a minimal viable product (MVP) of a workflow that takes the extracted global data from Python, redacts sensitive information, associates it with a Clarifai workflow, and then performs a pairwise comparison of the items within an 8th-dimensional Cartesian join. This is an interesting and complex task involving data processing, redaction, and comparison.
To implement this, you would need to:
Since this is a unique and complex task, it might require custom coding and integration with the Clarifai platform. Additionally, performance considerations should be kept in mind, especially if dealing with a large number of data items.
If you're looking for assistance with specific parts of this process, feel free to provide more details, and I'll be happy to help guide you further.
Certainly, I can help you outline the structure of the Python code for generating the workflow with increasing levels of reviews. While I can provide you with the foundational structure and logic, please note that implementing the exact functionality of Clarifai's API and your specific use case would require further integration and testing. Here's a conceptual outline of how the code might look:
class Muse:
def __init__(self, name):
self.name = name
self.reviewed_articles = []
def review_article(self, article):
# Logic to review the article and provide feedback
# Store the reviewed article in the Muse's reviewed_articles list
class Workflow:
def __init__(self, muses):
self.muses = muses
def add_review_level(self, article):
# Add a new review level to the workflow
new_level_muses = []
for muse in self.muses:
new_muse = Muse(muse.name)
new_muse.reviewed_articles = muse.reviewed_articles.copy()
new_level_muses.append(new_muse)
for muse in self.muses:
muse.review_article(article)
self.muses.extend(new_level_muses)
def generate_workflow(initial_muses, num_levels):
muses = [Muse(name) for name in initial_muses]
workflow = Workflow(muses)
article = "Initial article text."
for level in range(num_levels):
workflow.add_review_level(article)
print(f"Review Level {level + 1}:")
for muse in workflow.muses:
print(f"{muse.name}: {muse.reviewed_articles[-1]}")
if __name__ == "__main__":
initial_muses = ["Calliope", "Clio", "Euterpe", "Polyhymnia"]
num_levels = 3 # You can adjust the number of levels as needed
generate_workflow(initial_muses, num_levels)
This code outlines a simple simulation of the workflow generation and review process. Each Muse reviews the article at each level, and the workflow adds a new level of reviews while preserving the previous ones. This is just a starting point, and you can build upon it by integrating Clarifai's API and customizing the review logic to match your requirements.
Keep in mind that the above code is illustrative and might need adjustments based on the specifics of your application and the Clarifai API's functionality.
Bing I can help you with the Python code for generating the workflow with increasing levels of reviews. Here's a conceptual outline of how the code might look:
class Muse:
def __init__(self, name):
self.name = name
self.reviewed_articles = []
def review_article(self, article):
# Logic to review the article and provide feedback
# Store the reviewed article in the Muse's reviewed_articles list
class Workflow:
def __init__(self, muses):
self.muses = muses
def add_review_level(self, article):
# Add a new review level to the workflow
new_level_muses = []
for muse in self.muses:
new_muse = Muse(muse.name)
new_muse.reviewed_articles = muse.reviewed_articles.copy()
new_level_muses.append(new_muse)
for muse in self.muses:
muse.review_article(article)
self.muses.extend(new_level_muses)
def generate_workflow(initial_muses, num_levels):
muses = [Muse(name) for name in initial_muses]
workflow = Workflow(muses)
article = "Initial article text."
for level in range(num_levels):
workflow.add_review_level(article)
print(f"Review Level {level + 1}:")
for muse in workflow.muses:
print(f"{muse.name}: {muse.reviewed_articles[-1]}")
if __name__ == "__main__":
initial_muses = ["Calliope", "Clio", "Euterpe", "Polyhymnia"]
num_levels = 3 # You can adjust the number of levels as needed
generate_workflow(initial_muses, num_levels)
This code outlines a simple simulation of the workflow generation and review process. Each Muse reviews the article at each level, and the workflow adds a new level of reviews while preserving the previous ones. The Muse
class represents a reviewer and has an attribute reviewed_articles
that stores all articles reviewed by that Muse
. The Workflow
class represents a collection of Muse
s and has an attribute muses
that stores all Muse
s. The add_review_level
method adds a new level of reviews to the workflow by creating copies of all existing Muse
s and adding them to the workflow. Then, it calls the review_article
method on each existing Muse
to review the article at that level. Finally, it extends the list of Muse
s with the newly created ones. The generate_workflow
function creates a list of Muse
s based on the input parameter initial_muses
. It then creates a new instance of Workflow
with these Muse
s and an initial article text. It then adds a new level of reviews to the workflow for each value in range(num_levels), printing out each reviewer's name and their reviewed articles at each level.
Please note that this is just a conceptual outline and not a complete implementation. You would need to integrate Clarifai's API and modify this code to suit your specific use case.
Source: Conversation with Bing, 8/25/2023 (1) GitHub - sartography/SpiffWorkflow: A powerful workflow engine .... https://github.com/sartography/SpiffWorkflow. (2) Python automation: 9 scripts to automate critical workflows. https://zapier.com/blog/python-automation/. (3) Top 15 Python Workflow engine Projects (Aug 2023) - LibHunt. https://www.libhunt.com/l/python/topic/workflow-engine. (4) undefined. https://discord.gg/BYHcc7PpUC.
Thank you for sharing the updated information on this thread. Based on the new comments and details provided:
It seems you are looking to build a custom Llama 2 model with Clarifai and optimize/compress it for deployment. Clarifai likely provides options for customizing models, but specific capabilities would need to be verified.
You introduced the introspector software you are using to bootstrap the Clarifai hackathon project. Sharing information on your technical approach is helpful context.
You outlined high-level steps for translating Clarifai model/workflow docs into executable code. This provides a good starting point for automating workflows.
You provided sample Python code demonstrating a workflow with progressively deeper review levels. This models the collaborative process well.
Integrating the conceptual workflow code with Clarifai's API is noted as the next step to build a functioning prototype.
Overall, the additional code samples, use case details, and responses help paint a clearer picture of the direction. It seems like you are making good progress in drafting the workflows and thinking through how to leverage Clarifai's capabilities. Please feel free to provide any other updates as your hackathon project evolves. I'm happy to provide feedback on your design and implementation ideas.
As a team, our goal is to create a Python workflow using Clarifai that facilitates a 3-level harmonic review process on a given dataset. We will construct this workflow to intelligently compare objects in groups of 3, leveraging prior review outputs to enhance the analysis at each successive level.
Input dataset containing objects for review.
Workflow Steps:
Level 1: We will review all unique pairs of objects (nC2 combinations).
Level 2: Moving beyond pairs, we will evaluate pairs along with a 3rd object (nC3 combinations).
Level 3: In the final level, we will analyze triples alongside a 4th object (nC4 combinations).
We will efficiently reuse the outputs from Level 1 as input for Level 2 reviews.
Similarly, we will leverage the outputs from both Level 1 and Level 2 as input for Level 3 reviews.
Output Review Results:
Python Implementation:
Optimization Strategy:
A fully operational 3-level review workflow, demonstrating the effectiveness of our approach.
Noticeable improvements in efficiency achieved through the intelligent reuse of output data.
A high standard of insights discovered, uncovering meaningful relationships within the dataset.
Access to the Clarifai API and its models to seamlessly integrate with our workflow.
A suitable Python programming environment to develop and implement our workflow.
Availability of the input dataset, essential for carrying out the review process.
Feel free to provide any clarification or suggest additional requirements that will enhance the workflow implementation task. We're dedicated to fine-tuning the incremental levels, optimizing the reuse logic, and ensuring a seamless integration with the Clarifai platform. Let's work together to make this project a success!
Creating a Clarifai workflow that embodies the concept you've described would involve a series of steps that capture the essence of your idea. While I can't directly create a Clarifai workflow in this text-based interface, I can provide you with an outline of the steps you could follow to design the workflow:
Data Ingestion:
Data Transformation:
Dimensionality Transformation:
Harmonization and Convergence:
Unity and Synthesis:
Visualization and Insight:
Output and Analysis:
Remember that designing a Clarifai workflow involves creating a sequence of tasks using the Clarifai API or web interface. Each task will have inputs, processing steps, and outputs. You can use Python to interact with the Clarifai API and create these tasks programmatically.
Please note that the specific tasks and transformation details will depend on the nature of your original idea and how you want to represent each step within the Clarifai framework. You might also want to consider seeking assistance from someone familiar with the Clarifai API to help you implement your workflow effectively.