Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Free Learning
Arrow right icon

How-To Tutorials - LLM

81 Articles
article-image-ai-distilled-2-google-gen-ai-search-engine-microsoft-fabric-nvidia-dgx-supercomputer-google-matcha-succeed-in-ai
Merlyn Shelley
05 Jun 2023
10 min read
Save for later

AI_Distilled #2: Google Gen AI Search Engine, Microsoft Fabric, NVIDIA DGX Supercomputer, Google MatCha, Succeed in AI

Merlyn Shelley
05 Jun 2023
10 min read
“AI is going to touch literally every single industry. While some worry that AI may take their jobs, someone who’s expert with AI will." - Jensen Huang, Founder and CEO, NVIDIA In a world where AI revolutionizes all industries, fears of job loss fade when you become an AI expert. Embrace the power of AI to unlock boundless opportunities and shape the future!  Welcome to the second issue of AI_Distilled newsletter — your essential guide to the latest developments in AI/ML, LLMs, GPT, NLP, and Generative AI! In this edition, we’ll start with the latest AI buzz, including Google’s newly launched AI search engine, the unveiling of Microsoft Fabric — a new analytics platform for the AI era, NVIDIA’s cutting-edge DGX supercomputer, scientists’ breakthrough discovery of a lifesaving antibiotic using AI, and Microsoft’s recently released report on AI governance proposing “safety brakes” to ensure critical AI always remain under human control. We’ve also got you your fresh dose of AI secret knowledge and tutorials. The AI Product Manager's Handbook, Building your own LLM-powered chatbot in 5 minutes with HugChat and Streamlit, see how Google’s MatCha revolutionizes Computer understanding of Visual Language and Chart Reasoning, and discover why self-healing software could become a tangible reality in the era of LLMs.  What do you think of this issue and our newsletter? Please consider taking the short survey below to share your thoughts and you will get a free PDF of the “The Applied Artificial Intelligence Workshop” eBook upon completion. Complete the Survey. Get a Packt eBook for Free! Writer’s Credit: Special shout-out to Vidhu Jain for their valuable contribution to this week’s newsletter content! Cheers, Merlyn Shelley, Editor-in-Chief, Packt  ⚡ TechWave: AI/GPT News & Analysis Google Launches its New AI Search Engine: Google has opened access to its new generative AI search capabilities, called Search Labs, the new program lets you access early experiments from Google. Sign up for the waitlist and start testing new Labs experiments, including SGE (Search Generative Experience), Code Tips and Add to Sheets. The enhanced search experience simplifies the search process, helping you grasp a topic more quickly, discover fresh perspectives and valuable insights, and accomplish tasks with greater ease. Microsoft Build Unveils AI-powered Shift in Technology Space: Microsoft Build, the annual flagship event for developers, showcased the major shift in the technology space driven by artificial intelligence (AI). The event highlighted the adoption of AI copilots and plugins across various Microsoft offerings, including Bing, Dynamics 365 Copilot, and Microsoft 365 Copilot. Microsoft also announced the growth of the AI plugin ecosystem, the introduction of Azure AI tooling for developers, initiatives for building responsible AI systems, the unified analytics platform Microsoft Fabric, and collaborations with partners like NVIDIA. Windows 11 will also feature new AI-driven experiences with Windows Copilot. Microsoft Launches Microsoft Fabric, the New Analytics Platform ‘for AI era’: Microsoft Fabric debuts as a comprehensive and integrated analytics platform designed to meet the diverse needs of organizations. This end-to-end solution seamlessly combines various data and analytics tools, including Azure Data Factory, Azure Synapse Analytics, and Power BI, into a single unified product. Fabric empowers data and business professionals to maximize the value of their data, enabling them to delve deeper into insights and enhance decision-making processes.  OpenAI Launches $1M Grants Program for Democratic Inputs to AI: OpenAI has announced that it will fund ten grants of $100,000 each, aimed at supporting experiments in establishing a democratic framework for determining the guidelines that govern the behavior of AI systems while staying within legal boundaries. Recognizing that AI’s impact will be “significant” and “far-reaching,” the ChatGPT creator wants decisions concerning how AI behaves to be influenced by diverse public perspectives. The deadline to submit the grant application is June 24, 2023. Microsoft Releases AI Governance Report: Microsoft has published a report titled "Governing AI: A Blueprint for the Future," which outlines guidelines for governments in formulating policies and regulations related to AI. The report emphasizes five key areas for consideration, including the creation of “fail-safe safety brakes” for AI systems that control critical infrastructure including city traffic systems and electrical grids to ensure AI is always under human control. The report highlights Microsoft's commitment to ethical AI practices and how the company is implementing responsible AI principles within its operations. Scientists Harness AI to Unleash Powerful Antibiotic Against Deadly Superbug: Scientists have utilized artificial intelligence (AI) to identify a new antibiotic capable of combating a dangerous superbug. In a study published in Nature Chemical Biology, researchers from McMaster University and MIT discovered a promising antibiotic, named abaucin, through the use of AI algorithms. The superbug in question, Acinetobacter baumannii, poses a severe threat to human health. The AI screening process enabled the identification of several potential antibiotics, with abaucin ultimately proving effective in suppressing the infection in laboratory tests.  NVIDIA Unveils DGX GH200 AI Supercomputer to Revolutionize Generative AI and Recommender Systems: NVIDIA has introduced the DGX GH200 AI Supercomputer, a groundbreaking innovation that combines 256 Grace Hopper Superchips into a single, massive GPU, capable of delivering 1 exaflop of performance and 144 terabytes of shared memory. With advanced NVLink interconnect technology and the NVIDIA NVLink Switch System, the DGX GH200 empowers researchers to develop next-generation models for generative AI language applications, recommender systems, and data analytics workloads. Expert Insights from Packt Community The AI Product Manager's Handbook – By Irene Bratsis Succeeding in AI – how well-managed AI companies do infrastructure right Many large technology companies that depend heavily on ML have dedicated teams and platforms that focus on building, training, deploying, and maintaining ML models. The following are a few examples of options you can take when building an ML/AI program: Databricks has MLflow: MLflow is an open source platform developed by Databricks to help manage the complete ML life cycle for enterprises. It allows you to run experiences and work with any library, framework, or language.  Google has TensorFlow Extended (TFX): This is Google’s newest product built on TensorFlow and it’s an end-to-end platform for deploying production-level ML pipelines. It allows you to collaborate within and between teams and offers robust capabilities for scalable, high-performance environments. Uber has Michelangelo: Uber is a great example of a company creating their own ML management tool in-house for collaboration and deployment. Earlier, they were using disparate languages, models, and algorithms and had teams that were siloed. After they implemented Michelangelo, they were able to bring in varying skill sets and capabilities under one system.  The above content is extracted from the recently published book titled "The AI Product Manager's Handbook," authored By Irene Bratsis and published in Feb 2023. To get a glimpse of the book's contents, make sure to read the free chapter provided here, or if you want to unlock the full Packt digital library free for 7 days, try signing up now! To learn more, click on the button below.     Sit Back, Relax and Read More Here! Secret Knowledge: AI/LLM Resources LLMs Enabling Self-Healing Software that Repair Vulnerabilities Automatically: Researchers have introduced a groundbreaking solution that utilizes Large Language Models (LLMs) and Formal Verification techniques to automatically detect and fix software vulnerabilities. The method involves Bounded Model Checking (BMC) to identify vulnerabilities and generate counterexamples that highlight incorrect system behavior. These counterexamples, along with the source code, are then fed into an LLM engine, which uses a specialized prompt language for code debugging and generation. The repaired code is verified using BMC.  Google Research Introduces MatCha to Revolutionize Computer Understanding of Visual Language and Chart Reasoning: MatCha is a groundbreaking pixels-to-text foundation model that aims to improve computer understanding of visual language, including charts and graphs. Training on chart de-rendering and math reasoning tasks, MatCha surpasses previous models in ChartQA performance by over 20% and achieves comparable results in summarization systems with significantly fewer parameters. The research papers on MatCha and DePlot will be presented at ACL2023, and the models and code are available on Google Research's GitHub repository.  Dialogue-guided intelligent document processing with foundation models on Amazon SageMaker JumpStart: A dialogue-guided approach to intelligent document processing (IDP) using Amazon SageMaker JumpStart. IDP automates the processing of unstructured data and offers improvements over manual methods. The solution discussed in the article combines OCR, large language models (LLMs), task automation, and external data sources to enhance IDP workflows. Incorporating dialogue capabilities and generative AI technologies, the system becomes more efficient, accurate, and user-friendly.  Resolving Code Review Comments with Machine Learning: Google has implemented a machine learning (ML) system to automate and streamline the code review process, reducing the time spent on code reviews. By training a model to predict code edits based on reviewer comments, Google's system suggests code changes to authors, increasing their productivity and allowing them to focus on more complex tasks. The model has been calibrated to achieve a target precision of 50% and has successfully addressed 52% of comments in offline evaluations.  MasterClass: AI/LLM Tutorials Build LLM-powered chatbot in 5 minutes using HugChat and Streamlit: If you’re interested in building a chatbot using Language Models, this is a step-by-step guide on developing an LLM-powered chatbot using HugChat, a Python library that simplifies the integration of LLMs into chatbot applications and Streamlit, a user-friendly framework for creating interactive web applications.  Unlock the Potential of Unstructured Data with BigQuery Object Tables: Discover how Google Cloud's BigQuery Object Tables, now generally available, empower AI developers to analyze unstructured data more effectively. Object tables provide a structured record interface for unstructured data stored in Cloud Storage, enabling the use of SQL and AI models for processing and managing diverse data types. You can access Google’s guided lab and tutorials to get started with your project. Vertex AI Embeddings for Text: Grounding LLMs Easily: Explore the concept of grounding and learn about Vertex AI Embeddings for Text and Matching Engine, including its key features. Learn how to build reliable Gen AI services for enterprise use, enabling deep semantic understanding and enhancing user experiences in applications such as search, classification, recommendation, and clustering. You can access the Vertex AI Embeddings for Text API documentation here and see the Stack Overflow semantic search demo on GitHub. Getting Started with Generative AI Studio on Google Cloud: Google Cloud offers Generative AI Studio, a user-friendly console tool for prototyping and testing generative AI models. This article provides step-by-step instructions on using Generative AI Studio through the Google Cloud user interface, without the need for REST API or Python SDK. Further resources are available in the GitHub repository for those interested in learning more about using Generative AI Studio.  HackHub: Trending AI Tools SamurAIGPT/privateGPT: Create a QnA chatbot on your documents without relying on the internet by utilizing the capabilities of local LLMs with complete privacy and security.  facebookresearch/fairseq: A sequence modeling toolkit that allows researchers and developers to train custom models for translation, summarization, language modeling, and other text generation tasks.  iperov/DeepFaceLive: Swap your face from a webcam or the face in the video using trained face models. geohot/tinygrad: Aims to be the easiest deep learning framework to add new accelerators to, with support for both inference and training.  OpenGVLab/InternGPT: A pointing-language-driven visual interactive system, allowing you to interact with ChatGPT by clicking, dragging, and drawing using a pointing device.
Read more
  • 0
  • 0
  • 139

article-image-ai-distilled-1-scikit-llm-privacy-in-ml-models-and-chatgpt-copilot-in-windows-11
Kartikey Pandey, Vidhu Jain
05 Jun 2023
8 min read
Save for later

AI_Distilled #1: Scikit-LLM, Privacy in ML Models, and ChatGPT Copilot in Windows 11

Kartikey Pandey, Vidhu Jain
05 Jun 2023
8 min read
Welcome to the first issue of our newsletter — a treat for anyone interested in AI including developers, engineers, AI practitioners, and enthusiasts who live and breathe AI/ML, LLMs, NLP, Generative AI, and all related fields! This is a newsletter from Packt that combines original ideas and curated content for you. Deep dives, industry developments, interesting tools, and tools, all in one place. If it’s not the right area for you, please click on the unsubscribe button at the footer of this email.In this edition, we’ll examine differential privacy approaches in ML models, take a look at Scikit-LLM, that allows developers to seamlessly integrate language models into scikit-learn for enhanced text analysis, and explore why Microsoft is emphasizing the importance of causal inference in ML.We’ll learn how to quickly deploy your own ChatGPT-based apps and explore the concept of AI hallucinations, where AI attempts to overreach itself in misleading (and often terrifying) ways. More in today’s issue:TechWave: AI/GPT News & AnalysisSecret Knowledge: AI/LLM ResourcesMasterclass: AI/LLM TutorialsIndustry Experts SpeakHackHub: Trending AI ToolsCoding your new app? Working on the next GPT breakthrough? Trying to reduce ML inference latency? We’re here to help you stay updated and make sense of the rapidly changing AI landscape!What do you think of this issue and our newsletter? Please consider taking the short survey below to share your thoughts and you will get a free PDF of the “The Applied Artificial Intelligence” eBook upon completion.Until next time!Kartikey Pandey, Vidhu JainEditor-in-ChiefsComplete the Survey. Get a Packt eBook for Free! ⚡ TechWave: AI/GPT News & Analysis ChatGPT iOS App Released: OpenAI has released the much-awaited ChatGPT app for iOS. The app will sync your search history across all your devices and supports voice input for hands-free operation on your iPhone on the go. You can download the app here. The app is being initially rolled out in the US and will be available in more regions in the coming days. OpenAI has promised an Android version soon.Built-in ChatGPT-driven Copilot Will be Added to Windows 11: Microsoft is adding a new ChatGPT-driven Copilot feature in Windows 11 that can be used alongside other Windows apps. It will be available to Windows Insiders in June. It can change Windows settings, rearrange windows with Snap Layouts, summarize and rewrite documents, open apps, and more. There will also be a dedicated button for Windows Copilot on the taskbar.Scikit-LLM: Scikit-LLM allows developers to seamlessly integrate language models into scikit-learn for enhanced text analysis tasks. Scikit-LLM is still under development and it plans to add support for more models and fine-tuning. It features zero-shot text classification, multi-label zero-shot text classification, and text vectorization. GitHub repo here.New Image-to-Speech Generative AI App: AWS architects designed a novel web application, an image-to-speech Generative AI solution that empowers individuals with visual challenges to comprehend images through image captioning, facial recognition, and text-to-speech, leveraging Amazon SageMaker and Hugging Face. The website creates detailed descriptions of uploaded images and reads them out in a nature-sounding voice. The team used Hugging Face’s OFA model, a unified multi-model pre-trained model.dreamGPT Puts LLM Hallucinations to Creative Use: A new GPT-based tool turns LLM hallucination on its head and uses it to foster divergent thinking to generate unique insights and ideas for inspiration (think poetry). Contrary to conventional tools that use LLM models to solve specific challenges, dreamGPT ‘dreams’ of new ideas and amalgamates them to create novel concepts. You can access the GitHub repo here.Google Launches AI Product Studio: Google has started to deploy more generative technologies to their products. Google says Product Studio gives merchants the ability to create product imagery for free and get more value from the images they already have. You can create new imagery without the added cost of new photoshoots.Secret Knowledge: AI/LLM Resources How to Use Synthetic Control Method (SCM) for Causal Inference: Traditional ML models overlook causal relationships in favor of correlation. Many real-world instances need cause-effect dynamics, for example, when randomized control trials (A/B testing) are not feasible. Causal effects are also more resilient to model drifts. The article shows how you can estimate causal effects using machine learning with a synthetic control group instead of A/B testing. SCM (Synthetic Control Method) involves creating a synthetic control group that closely resembles the target group and using it to estimate the causal effect of an intervention. CRITIC: A New Framework for Self-Correcting AI Language Models: Researchers have introduced a system named CRITIC, which allows large language models (LLMs) to validate and improve their own outputs in a way similar to humans using tools for fact-checking or debugging. The process involves the model producing an initial output, interacting with tools to evaluate it, and then revising the output based on the feedback received, which has been proven to enhance the performance of LLMs in areas like question answering, program synthesis, and reducing toxicity.Leveraging Reinforcement Learning to Facilitate Dynamic Planning in Open-Ended Discussions: Dynamic planning is the ability to modify the original plan of a conversation based on its flow, allowing for flexible and engaging interactions. In the context of virtual assistants, dynamic planning enables deeper, multi-turn conversations that adapt to user preferences and goals. Traditional LLMs excel at generating individual responses but lack the capacity for forward planning. Novel RL constructions utilize supervised models, such as RNNs and transformers, to represent dialogue states effectively.Differentially Privacy in ML Models: Best Practices and Open Challenges: The article discusses the importance of protecting the privacy of training data in machine learning (ML) models. It introduces the concept of Differential Privacy (DP) which allows for data anonymization in ML models. Get to know the challenges in achieving good utility with differentially private ML techniques and explore the common techniques for obtaining differentially private ML models. The research emphasizes the need for practitioners to choose the right privacy unit, privacy guarantees, and perform hyperparameter tuning effectively. You can read the complete survey paper here.VideoLLM: A Tool for Video Analysis using LLMs: Leveraging the power of language processing models, the newly proposed VideoLLM system converts all video inputs into a type of language that can be analyzed more efficiently. By successfully testing on multiple datasets, VideoLLM proves that it can handle various tasks, suggesting that model's reasoning abilities can be effectively used for understanding and analyzing video content. GitHub repo here. MasterClass: AI/LLM Tutorials Quickly build ChatGPT apps in 5 steps with this low-code platform: This tutorial introduces the use of the low-code solution, ToolJet, to rapidly develop ChatGPT apps. Traditionally, creating and integrating apps with ChatGPT required programming expertise and time-consuming development cycles. ToolJet offers seamless integration with OpenAI, enabling developers to quickly build applications that leverage ChatGPT's capabilities in 5 steps:Sign up for a ToolJet accountCreate a new appSelect OpenAI pluginEnter your Organization ID and API KeyFetch OpenAI dataPrompt Engineering (GitHub Copilot) Beginner’s Guide: This tutorial explores how you can get started with Prompt Engineering using GitHub Copilot and practice writing and iterating on prompts yourself. First, let's start with the basics for folks who are unfamiliar with GitHub Copilot or prompt engineering. Read the full tutorial here ->How to Use Alpa and Ray to Efficiently Scale LLM training Across a Large GPU Cluster: This post explores the integration of Alpa.ai and Ray.io frameworks, highlighting their combined capabilities to train a massive 175 billion-parameter JAX transformer model with pipeline parallelism. We delve into the architectures, developer-friendly APIs, scalability, and performance of these frameworks. Both Alpa and Ray enhance developer productivity and optimize model scalability. Alpa's pipeline parallelism efficiently distributes computation across multiple GPUs, relieving developers of cognitive load. Ray provides a distributed computing framework for simplified resource scaling and management across multiple machines. Industry Experts Speak “No one in the field has yet solved the hallucination problems”- Sundar Pichai, Google and Alphabet CEOLLMs can deliver inaccurate information with a confident tone, often misleading unsuspecting users. Called hallucinations or confabulations, this is one of the major challenges with AI.“This new generation of AI will remove the drudgery of work and unleash creativity, and today we're sharing our latest Work Trend Index findings as we apply technology to help alleviate digital debt, build AI aptitude, and empower employees”-Satya Nadella, Microsoft Chairman and CEOThe latest Microsoft Work Trend Index report shows how AI is redefining the future of work. 49% of surveyed employees are fearful AI will replace their jobs while 70% would readily delegate workloads to AI to simplify their professional life and bolster creativity. HackHub: Trending AI Tools StanGirard/Quivr: Quivr calls itself “your second brain in the cloud”. It’s very convenient to dump all your files and thoughts and retrieve unstructured information, powered by generative AI.FlowiseAI/Flowise: Drag & drop UI to build your customized LLM flow using LangchainJS.Ricklamers/gpt-code-ui: An open-source implementation of OpenAI's ChatGPT Code interpreter.Stability-AI/StableStudio: StableStudio is Stability AI's official open-source variant of DreamStudio (user interface for generative AI). It is a web-based application that allows users to create and edit generated images. 0nutation/SpeechGPT: LLM with intrinsic cross-modal conversational abilities, capable of perceiving and generating multi-model content following human instructions.
Read more
  • 0
  • 0
  • 218

article-image-set-up-and-run-auto-gpt-with-docker
Rohan Chikorde
04 Jun 2023
8 min read
Save for later

Set Up and Run Auto-GPT with Docker

Rohan Chikorde
04 Jun 2023
8 min read
Are you looking to get your hands dirty with Auto-GPT? Look no further! In this article, we'll guide you through the straightforward installation process, enabling you to effortlessly set up Auto-GPT and unlock its powerful capabilities. Say goodbye to complex setups and hello to enhanced language generation in just a few simple steps. To use Auto-GPT, users need to have Python installed on their computer, as well as an OpenAI API key. This key allows Auto-GPT to access the GPT-4 and GPT-3.5 APIs, as well as other resources such as internet search engines and popular websites. Once it is configured, users can interact with Auto-GPT using natural language commands, and the AI agent will automatically perform the requested task. We will show practically how to set up and run Auto-GPT using Docker. We will also be showing steps to other popular methods towards the end. Benefits of using Docker for running Auto-GPT  Docker is a containerization technology that allows developers to create, deploy, and run applications in a consistent and isolated environment. It enables the packaging of an application and all its dependencies into a single container, which can be easily distributed and run on any machine that has Docker installed. Using Docker to run Auto-GPT provides several benefits:It allows you to run Auto-GPT in an isolated and reproducible environment, which ensures that the dependencies and configurations required to run Auto-GPT are consistent across different machines. This can be especially useful when collaborating on a project or when deploying Auto-GPT to a production environment. Docker provides a secure sandboxed environment, which can help prevent any potential harm to your computer from continuous mode malfunctions or accidental damage from commands.  Docker simplifies the installation and configuration process of Auto-GPT by packaging it in a container that includes all the necessary dependencies and libraries. This means you don't have to manually install and configure these dependencies, which can be time-consuming and error prone. Overall, using Docker to run Auto-GPT provides a convenient and secure solution for developing and deploying Auto-GPT in a consistent and reproducible manner.Software Requirements Docker (recommended)  Python 3.10 or later  VSCode + devcontainer Getting an API key  Get your OpenAI API key from: https://platform.openai.com/account/api-keys   Fig 1. Creating API keySetting up Auto-GPT with DockerHere first we will showcase step by step by guide to set up Auto-GPT using docker.1.     Make sure you have Python and Docker are installed on your system and its daemon is running, see requirements Fig 2. Command Prompt  2.     Open CMD and Pull the latest image from Docker Hub using following command:docker pull significantgravitas/auto-gpt Fig 3. Pulling image from dockerhub Please note if docker daemon is not running it will throw an error. Fig 4. Docker Image Once pulled using above command, you can find the significantgravitas/auto-gpt image on your docker. 3.     Create a folder for Auto-GPT4.     In the folder, create a file named docker-compose.yml with the following contents:version: "3.9"services:  auto-gpt:    image: significantgravitas/auto-gpt    depends_on:      - redis    env_file:      - .env    environment:      MEMORY_BACKEND: ${MEMORY_BACKEND:-redis}      REDIS_HOST: ${REDIS_HOST:-redis}    profiles: ["exclude-from-up"]    volumes:      - ./auto_gpt_workspace:/app/auto_gpt_workspace      - ./data:/app/data      ## allow auto-gpt to write logs to disk      - ./logs:/app/logs      ## uncomment following lines if you have / want to make use of these files      #- ./azure.yaml:/app/azure.yaml      #- ./ai_settings.yaml:/app/ai_settings.yaml  redis:    image: "redis/redis-stack-server:latest" 5.     Download Source code(zip) from the latest stable release6.     Extract the zip-file into a folder. Fig 5. Source folder Configuration using Docker 1.     After downloading and unzipping the folder, find the file named .env.template in the main Auto-GPT folder. This file may be hidden by default in some         operating systems due to the dot prefix. To reveal hidden files, follow the instructions for your specific operating system: Windows, macOS2.     Create a copy of .env.template and call it .env; if you're already in a command prompt/terminal window: use cp .env.template .env3.     Now you should have only two files in your folder – docker-compose.yml and .env Fig 6.  Docker-compose and .env files 4.     Open the .env file in a text editor5.     Find the line that says OPENAI_API_KEY=6.     After the =, enter your unique OpenAI API Key without any quotes or spaces.7.     Extracting API key is discussed in step 1 (discussed above).8.     Save and close .env file Running Auto-GPT with Docker Easiest is to use docker-compose. Run the commands below in your Auto-GPT folder.1.     Build the image. If you have pulled the image from Docker Hub, skip this stepdocker-compose build auto-gpt2.     Run Auto-GPTdocker-compose run --rm auto-gpt3.     By default, this will also start and attach a Redis memory backend. If you do not want this, comment or remove the depends: - redis and redis: sections           from docker-compose.yml4.     You can pass extra arguments, e.g., running with --gpt3only and --continuous:docker-compose run --rm auto-gpt --gpt3only –continuous Fig 7. Auto-GPT Installed Other methods without Docker Setting up Auto-GPT with Git 1.     Make sure you have Git installed for your OS2.     To execute the given commands, open a CMD, Bash, or PowerShell window. On Windows: press Win+X and select Terminal, or Win+R and enter cmd3.     First clone the repository using following command:git clone -b stable https://github.com/Significant-Gravitas/Auto-GPT.git4.     Navigate to the directory where you downloaded the repositorycd Auto-GPT Manual Setup 1.     Download Source code (zip) from the latest stable release2.     Extract the zip-file into a folderConfiguration 1.     Find the file named .env.template in the main Auto-GPT folder. This file may be hidden by default in some operating systems due to the dot prefix. To reveal hidden files, follow the instructions for your specific operating system: Windows, macOS2.     Create a copy of .env.template and call it .env; if you're already in a command prompt/terminal window: cp .env.template .env3.     Open the .env file in a text editor4.     Find the line that says OPENAI_API_KEY=5.     After the =, enter your unique OpenAI API Key without any quotes or spaces6.     Save and close the .env file Run Auto-GPT without Docker Simply run the startup script in your terminal. This will install any necessary Python packages and launch Auto-GPT. Please note, if the above configuration is not properly setup, then it will throw an error, hence recommended and easiest way to run is using docker.On Linux/MacOS:./run.shOn Windows:.\run.batIf this gives errors, make sure you have a compatible Python version installed. ConclusionIn conclusion, if you're looking for a hassle-free way to install Auto-GPT, Docker is the recommended choice. By following our comprehensive guide, you can effortlessly set up Auto-GPT using Docker, ensuring a streamlined installation process, consistent environment configuration, and seamless deployment on different platforms. With Docker, bid farewell to compatibility concerns and embrace a straightforward and efficient Auto-GPT installation experience. Empower your language generation capabilities today with the power of Docker and Auto-GPT.Author BioRohan is an accomplished AI Architect professional with a post-graduate in Machine Learning and Artificial Intelligence. With almost a decade of experience, he has successfully developed deep learning and machine learning models for various business applications. Rohan's expertise spans multiple domains, and he excels in programming languages such as R and Python, as well as analytics techniques like regression analysis and data mining. In addition to his technical prowess, he is an effective communicator, mentor, and team leader. Rohan's passion lies in machine learning, deep learning, and computer vision.You can follow Rohan on LinkedIn
Read more
  • 0
  • 0
  • 1504
Banner background image

article-image-text-to-image-prompt-engineering-tips-stable-diffusion
Emily Webber
04 Jun 2023
7 min read
Save for later

Text-to-Image Prompt Engineering Tips: Stable Diffusion

Emily Webber
04 Jun 2023
7 min read
This article is an excerpt from the book, Pretrain Vision and Large Language Models in Python, by Emily Webber. This book will help you pretrain and fine-tune your own foundation models from scratch on AWS and Amazon SageMaker, while applying them to hundreds of use cases across your organization.Stable Diffusion is a revolutionary model that allows you to unleash your creativity by generating captivating images through natural language prompts. This article explores the power of Stable Diffusion in producing high-resolution, black-and-white masterpieces, inspired by renowned artists like Ansel Adams. Discover valuable tips and techniques to enhance your Stable Diffusion results, including adding descriptive words, utilizing negative prompts, upscaling images, and maximizing precision and detail. Dive into the world of hyperparameters and learn how to optimize guidance, seed, width, height, and steps to achieve stunning visual outcomes. Unleash your artistic vision with Stable Diffusion's endless possibilities. Stable Diffusion is a great model you can use to interact with via natural language and produce new images. The beauty, fun, and simplicity of Stable Diffusion-based models are that you can be endlessly creative in designing your prompt. In this example, I made up a provocative title for a work of art. I asked the model to imagine what it would look like if created by Ansel Adams, a famous American photographer from the mid-twentieth century known for his black-and-white photographs of the natural world. Here was the full prompt: “Closed is open” by Ansel Adams, high resolution, black and white, award-winning. Guidance (20). Let’s take a closer look.Figure 1 – An image generated by Stable DiffusionIn the following list, you’ll find a few helpful tips to improve your Stable Diffusion results:Add any of the following words to your prompt: Award-winning, high resolution, trending on <your favorite site here>, in the style of <your favorite artist here>, 400 high dpi, and so on. There are thousands of examples of great photos and their corresponding prompts online; a great site is Lexica. Starting from what works is always a great path. If you’re passionate about vision, you can easily spend hours of time just pouring through these and finding good examples. For a faster route, that same site lets you search for words as a prompt and renders the images. It’s a quick way to get started with prompting your model. Add negative prompts: Stable Diffusion offers a negative prompt option, which lets you provide words to the model that it will explicitly not use. Common examples of this are hands, humans, oversaturated, poorly drawn, and disfigured.Upscaling: While most prompting with Stable Diffusion results in smaller images, such as size 512x512, you can use another technique, called upscaling, to render that same image into a much larger, higher quality image, of size 1,024x1,024 or even more. Upscaling is a great step you can use to get the best quality Stable Diffusion models today, both on SageMaker (2) and through Hugging Face directly. (3) We’ll dive into this in a bit more detail in the upcoming section on image-to-image.Precision and detail: When you provide longer prompts to Stable Diffusion, such as including more terms in your prompt and being extremely descriptive about the types and styles of objects you’d like it to generate, you actually increase your odds of the response being good. Be careful about the words you use in the prompt. As we learned earlier in the chapter on bias, most large models are trained on the backbone of the internet. With Stable Diffusion, for better or for worse, this means you want to use language that is common online. This means that punctuation and casing actually aren’t as important, and you can be really creative and spontaneous with how you’re describing what you want to see.Order: Interestingly, the order of your words matters in prompting Stable Diffusion. If you want to make some part of your prompt more impactful, such as dark or beautiful, move that to the front of your prompt. If it’s too strong, move it to the back.Hyperparameters: These are also relevant in language-only models, but let’s call out a few that are especially relevant to Stable Diffusion. Key hyperparameters for Stable Diffusion prompt engineering Guidance: The technical term here is classifier-free guidance, and it refers to a mode in Stable Diffusion that lets the model pay more (higher guidance) or less (lower guidance) attention to your prompt. This ranges from 0 up to 20. A lower guidance term means the model is optimizing less for your prompt, and a higher term means it’s entirely focused on your prompt. For example, in my image in the style of Ansel Adams above, I just updated the guidance term from 8 to 20. In the guidance=8 in Figure 13.3, you see a rolling base and gentle shadows. However, when I updated to guidance=20 on the second image, the model captures the stark contrast and shadow fades that characterized Adams’ work. In addition, we have a new style, almost like M. C. Escher, where the tree seems to turn into the floor. Seed: This refers to an integer you can set to baseline your diffusion process. Setting the seed can have a big impact on your model response. Especially if my prompt isn’t very good, I like to start with the seed hyperparameter and try a few random starts. Seed impacts high-level image attributes such as style, size of objects, and coloration. If your prompt is strong, you may not need to experiment heavily here, but it’s a good starting point. Width and height: These are straightforward; they’re just the pixel dimensions of your output image! You can use them to change the scope of your result, and hence the type of picture the model generates. If you want a perfectly square image, use 512x512. If you want a portrait orientation, use 512x768. For landscape orientation, use 768x512. Remember you can use the upscaling process we’ll learn about shortly to increase the resolution on the image, so start with smaller dimensions first. Steps: This refers to the number of denoising steps the model will take as it generates your new image, and most people start with steps set to 50. Increasing this number will also increase the processing time. To get great results, personally, I like to scale this against guidance. If you plan on using a very high guidance term (~16), such as with a killer prompt, then I wouldn’t set inference steps to anything over 50. This looks like it overfits, and the results are just plain bad. However, if your guidance scale is lower, closer to 8, then increasing the number of steps can get you a better result. SummaryIn conclusion, Stable Diffusion offers a fascinating avenue for creative expression through its image-generation capabilities. By employing strategic prompts, negative constraints, upscaling techniques, and optimizing hyperparameters, users can unlock the full potential of this powerful model. Embrace the boundless creativity and endless possibilities that Stable Diffusion brings to the world of visual art. Author BioEmily Webber is a Principal Machine Learning Specialist Solutions Architect and keynote speaker at Amazon Web Services, where she has led the development of countless solutions and features on Amazon SageMaker. She has guided and mentored hundreds of teams, developers, and customers in their machine-learning journey on AWS. She specializes in large-scale distributed training in vision, language, and generative AI, and is active in the scientific communities in these areas. She hosts YouTube and Twitch series on the topic, regularly speaks at re:Invent, writes many blog posts, and leads workshops in this domain worldwide. You can follow Emily on LinkedIn
Read more
  • 0
  • 0
  • 1351

article-image-responding-to-generative-ai-from-an-ethical-standpoint
Dr. Alex Antic
02 Jun 2023
7 min read
Save for later

Responding to Generative AI from an Ethical Standpoint

Dr. Alex Antic
02 Jun 2023
7 min read
This article is an excerpt from the book Creators of Intelligence, by Dr. Alex Antic. This book will provide you with insights from 18 AI leaders on how to build a rewarding data science career. As Generative Artificial Intelligence (AI) continues to advance, the need for ethical considerations becomes increasingly vital. In this article, we engage in a conversation between a Generative AI expert, Edward Santow, and an author to uncover practical ways to incorporate ethics into the rapidly evolving landscape of generative AI, ensuring its responsible and beneficial implementation. Importance of Ethics in Generative AI Generative AI is a rapidly developing field with the potential to revolutionize many aspects of our lives. However, it also raises a number of ethical concerns. Some of the most pressing ethical issues in generative AI include: Bias: Generative AI models are trained on large datasets of data, which can introduce bias into the models. This bias can then be reflected in the outputs of the models, such as the images, text, or music that they generate. Transparency: Generative AI models are often complex and difficult to understand. This can make it difficult to assess how the models work and to identify any potential biases. Accountability: If a generative AI model is used to generate harmful content, such as deepfakes or hate speech, it is important to be able to hold the developers of the model accountable. Privacy: Generative AI models can be used to generate content that is based on personal data. This raises concerns about the privacy of individuals whose data is used to train the models. Fairness: Generative AI models should be used in a way that is fair and does not discriminate against any particular group of people. It is important to address these ethical concerns in order to ensure that generative AI is used in a responsible and ethical manner. Some of the steps that can be taken to address these concerns include: Using unbiased data: When training generative AI models, it is important to use data that is as unbiased as possible. This can help to reduce the risk of bias in the models. Making models transparent: It is important to make generative AI models as transparent as possible. This can help to identify any potential biases and to make it easier to understand how the models work. Holding developers accountable: If a generative AI model is used to generate harmful content, it is important to be able to hold the developers of the model accountable. This can be done by developing clear guidelines and regulations for the development and use of generative AI. Protecting privacy: It is important to protect the privacy of individuals whose data is used to train generative AI models. This can be done by using anonymized data or by obtaining consent from individuals before using their data.Ensuring fairness: Generative AI models should be used in a way that is fair and does not discriminate against any group of people. This can be done by developing ethical guidelines for the use of generative AI.By addressing these ethical concerns, we can help to ensure that generative AI is used in a responsible and ethical manner. Ed Santow’s Opinion on Implementing Ethics Given the popularity and advances in generative AI tools, such as ChatGPT, I’d like to get your thoughts on how generative AI has impacted ethics frameworks. What complications has it added? Ed Santow: In one sense, it hasn’t, as the frameworks are broad enough and apply to AI generally, and their application depends on adapting to the specific context in which they’re being applied. One of the great advantages of this is that generative AI is included within its scope. It may be a newer form of AI, as compared with analytical AI, but existing AI ethics frameworks already cover a range of privacy and human rights issue, so they are applicable. The previous work to create those frameworks has made it easier and faster to adapt to the specific aspects of generative AI from an ethical perspective. One of the main complexities is the relatively low community understanding of how generative AI actually works and, particularly, the science behind it. Very few people can distinguish between analytical and generative AI. Most people in senior roles haven’t made the distinction yet or identified the true impact. The issue is, if you don’t understand the underlying technology well enough, then it’s difficult to make the frameworks work in practice. Analytical and generative AI share similar core science. However, generative AI can pose greater risks than simple classification AI. But the nature and scale of those risks generally haven’t been worked through in most organizations. Simply setting black-and-white rules – such as you can or can’t use generative AI – isn’t usually the best answer. You need to understand how to safely use it.   How will organizations need to adapt their ethical frameworks in response to generative AI?  Ed Santow: First and foremost, they need to understand that skills and knowledge are vital. They need to upskill their staff and develop a better understanding of the technology and its implications – and this applies at all levels of the organization. Second, they need to set a nuanced policy framework, outline how to use such technology safely and develop appropriate risk mitigation procedures that can flag when it’s not safe to rely on the outputs of generative AI applications. Most AI ethics frameworks don’t go into this level of detail. Finally, consideration needs to be given to how generative AI can be used lawfully. For example, entering confidential client data – or proprietary company data – into ChatGPT is likely to be unlawful, yet we also know this is happening.  What advice can you offer CDOs and senior leaders in relation to navigating some of these challenges?  Edward Santow: There are simply no shortcuts. People can’t assume that even though others in their industry are using generative AI, their organization can use it without considering the legal and ethical ramifications. They also need to be able to experiment safely with such technology. For example, a new chatbot based on generative AI shouldn’t be simply unleased on customers. They need to first test and validate it in a controlled environment to understand all the risks – including the ethical and legal ramifications. Leaders need to ensure that an appropriately safe test environment is established to mitigate any risk of harm to staff or customers. Summary In this article, we went through various ethical issues that can arise while implementing Generative AI and some ways to tackle these challenges effectively. We also learned certain practical best practices through an expert opinion from an expert in the field of Generative AI.  Author Bio :Dr. Alex Antic is an award-winning Data Science and Analytics Leader, Consultant, and Advisor, and a highly sought Speaker and Trainer, with over 20 years of experience. Alex is the CDO and co-founder of Healices Health - which focuses on advancing cancer care using Data Science and is co-founder of Two Twigs - a Data Science consulting, advisory, and training company. Alex has been described as "one of Australia’s iconic data leaders" and "one of the most premium thought leaders in data analytics globally". He was recognized in 2021 as one of the Top 5 Analytics Leaders by the Institute of Analytics Professionals of Australia (IAPA). Alex is an Adjunct Professor at RMIT University, and his qualifications include a Ph.D. in Applied Mathematics. LinkedIn
Read more
  • 0
  • 0
  • 160

article-image-introduction-to-llama
Dario Radečić
02 Jun 2023
7 min read
Save for later

Introduction to LLaMA

Dario Radečić
02 Jun 2023
7 min read
It seems like everyone, and their grandmothers, are discussing Large Language Models (LLMs) these days. These models got all the hype since ChatGPT's release in late 2022. The average user might get lost in acronyms such as GPT, PaLM, or LLaMA, and that’s understandable. This article will shed some light on why you should generally care about LLMs and exactly what they bring to the table. By the end of this article, you’ll have a fundamental understanding of the LLaMA model, how it compares to other large language models, and will have the 7B flavor of LLaMA running locally on your machine. There’s no time to waste, so let’s dive straight in! The Purpose of LLaMA and Other Large Language Models The main idea behind LLMs is to understand and generate human-like text based on the input you feed into them. Ask a human-like question and you’ll get a human-like response back. You know what we’re talking about if you’ve ever tried ChatGPT. These models are typically trained on huge volumes of data, sometimes even as large as everything that has been written on the Internet over some time span. This data is then fed into the algorithms using unsupervised learning which has the task of learning words and relationships between them. Large Language Models can be generic or domain-specific. You can use a generic LLM and fine-tune it for a certain task, similar to what OpenAI did with Codex (LLM for programming).As the end-user, you can benefit from LLMs in several ways:Content generation – You can use LLMs to generate content for personal or professional purposes, such as articles, emails, social media posts, and so on.Information retrieval – LLMs help you find relevant information quickly and often do a better job when compared to a traditional web search. Just be aware of the training date cap the model has – it might not do as well on the recent events.Language assistance and translation – These models can detect spelling errors and grammar mistakes, suggest writing improvements, provide synonyms, idioms, and even provide a meaningful translation from one language to another.At the end of the day, probably everyone can find a helpful use case in a large language model.But which one should you choose? There are many publicly available models, but the one that stands out recently is LLaMA. Let’s see why and how it works next. What is LLaMA and How it Works? LLaMA stands for “Large Language Model Meta AI” and is a large language model published by – you’ve guessed it – Meta AI. It was released in February 2023 in a variety of flavors – from 7 billion to 65 billion parameters.A LLaMA model uses the Transformer architecture and works by generating probability distributions over sequences of words (or tokens). In plain English, this means the LLaMA model predicts the next most reasonable word given the sequence of input words.It’s interesting to point out that LLaMA-13B (13 billion parameters) outperforms GPT-3 on most benchmarks, even though GPT-3 has 13 times more parameters (175 billion). The more parameter-rich LLaMA (65B parameters) is on par with the best large language models we have available today, according to the official paper by Meta AI.In fact, let’s take a look at these performance differences by ourselves. The following table from the official paper summarizes it well: Figure 1 - LLaMA performance comparison with other LLMs Generally speaking, the more parameters the LLaMA model contains, the better it performs. The interesting fact is that even the 7B version is comparable in performance – or even outperforms – the models with significantly more parameters. The 7B model performs reasonably well, so how can you try it out? In the next section, you’ll have LLaMA running locally with only two shell commands. How to Run LLaMA Locally? You’ll need a couple of things to run LLaMA locally – decent hardware (doesn’t have to be the newest), a lot of hard drive space, and a couple of software dependencies installed. It doesn’t matter which operating system you’re using, as the implementation we’re about to show you is cross-platform.For reference, we ran the 7B parameter model on an M1 Pro MacBook with 16 GB of RAM. The model occupied 31 GB of storage, and you can expect this amount to grow if you choose a LLaMA flavor with more parameters.Regarding software dependencies, you’ll need a recent version of Node. We used version 18.16.0 with  npm version 9.5.1.Once you have Node installed, open up a new Terminal/CMD window and run the following command. It will install the 7B LLaMA model: npx dalai llama install 7B You might get a prompt to install  dalai first, so just type  y into the console. Once Dalai is installed, it will proceed to download the model weights. You should see something similar during this process: Figure 2 - Downloading LLaMA 7B model weights It will take some time, depending on your Internet speed. Once done, you’ll have the 7B model available in the Dalie web UI. Launch it with the following shell command:npx dalai serve This is the output you should see: Figure 3 - Running dalai web UI locally The web UI is now running locally on port 3000. As soon as you open http://localhost:3000, you’ll be presented with the interface that allows you to choose the model, tweak the parameters, and select a prompting template.For reference, we’ve selected the chatbot template and left every setting as default. The prompt we’ve entered is “What is machine learning?” Here’s what the LLaMA model with 7B parameters outputted:  Figure 4 - Dalai user interface The answer is mostly correct, but the LLaMA response started looking like a blog post toward the end (“In this article…”). As with all large language models, you can use it to draw insights, but only after some human intervention.And that’s how you can run a large language model locally! Let’s make a brief recap next. ConclusionIt’s getting easier and cheaper to train large language models, which means the number of options you’ll have is only going to grow over time.LLaMA was only recently released to the public, and today you’ve learned what it is, got a high-level overview of how it works, and how to get it running locally. You might want to tweak the 7B version if you’re not getting the desired response or opt for a version with more parameters (if your hardware allows it). Either way, have fun!Author Bio:Dario Radečić is a Senior Data Scientist at Neos, Croatia. Book author: "Machine Learning Automation with TPOT".  Owner of betterdatascience.com. You can follow him on Medium: https://medium.com/@radecicdario
Read more
  • 0
  • 0
  • 2989
Unlock access to the largest independent learning library in Tech for FREE!
Get unlimited access to 7500+ expert-authored eBooks and video courses covering every tech area you can think of.
Renews at $19.99/month. Cancel anytime