A step-by-step guide to setting up a document-based question-answering assistant using LangChain and Facebook's open-source LLaMA large language model, along with a user-friendly interface built with Streamlit. (Also available in Chinese.)
TL;DR
The feature is a step-by-step guide to running open-source LLMs locally: LangChain plus Facebook's LLaMA for a document Q&A assistant, with Streamlit for the UI—and submissions are now open.
A step-by-step guide to setting up a document-based question-answering assistant using LangChain and Facebook's open-source LLaMA large language model, along with a user-friendly interface built with Streamlit. (Also available in Chinese.)
The article's test result is about 2Kb. In addition, the article also tested the following questions: How many bare coroutines can be created per second? How many coroutines can be processed per second? How much improvement can be achieved in creating and processing coroutine tasks after using uvloop?
asyncio.Runner is a new feature in Python 3.11 that allows you to execute multiple coroutines in the same event loop. The article covers how to run multiple coroutines using asyncio.run(), how to run multiple coroutines using the wrapper method, and how to use the asyncio.Runner class to execute coroutines in the same event loop in an adaptive or even conditional manner.
In concurrent programming, it is common to use locks, but it is important to avoid overusing them. This article explores how to achieve concurrency with minimal reliance on locks, using the example of generating short links. The main idea is to "ask for forgiveness" instead of "checking in advance" and to use features provided by the PostgreSQL database.
This article introduces how CPython runs Python code. The main processes are: lexical analysis, syntax analysis, compilation to bytecode, and execution of bytecode.
This article explores the concept of JIT compilation and its benefits, and provides an in-depth analysis of the advantages and disadvantages of popular Python JIT compilers (such as PyPy, Numba, and Cython). It also presents best practices and guidelines for using JIT compilers in Python.
When we say Python, we usually mean the official implementation CPython, but there are many other "Pythons", such as Pypy, Jython, MicroPython, Brython, RustPython, etc. There are also many things that look like new "Pythons", such as Nuitka, WinPython, Psycho, Pyjion, etc. This article explains the concepts and tools involved.
APScheduler is a scheduling and automation task tool. Its AsyncIOScheduler supports scheduling asynchronous functions and coroutines. The article introduces its functions, advantages, and how to optimize asynchronous task scheduling requirements.
GPT and other large language models can generate code quickly and in large quantities, but this can also lead to a lot of messy code. The article explores several ways to improve the code generated by these tools and integrate it into projects, including adopting an expert persona, providing examples, following best practices, adhering to standards and clear guidelines, and placing the code in the right place.
How can you improve NumPy performance without considering parallelization? NumPy has three inherent bottlenecks: eager execution, generic compiled code, and high memory usage due to vectorization. To address these bottlenecks, the article presents four solutions: hand-optimizing the code, using JAX for just-in-time compilation, using Numba for just-in-time compilation, and using ahead-of-time compilation.
Numba is a specialized just-in-time compiler that eliminates the overhead of interpretation by compiling Python code to efficient machine code, thereby improving performance. The article covers Numba's features, internals, key usage, and common gotchas.
How can you improve code quality with less time and effort? The article introduces several tools for improving code quality (flake8, Black, isort, mypy, bandit, etc.) and ways to automate these tools using IDEs, CI, and pre-commit.
PandasAI is a recently trending library that integrates AI conversational capabilities with Pandas, simplifying data manipulation. The article covers how to perform complex queries and visualize charts with PandasAI and introduces a dozen of its handy functions.
The benefits of unit testing are well-known, yet writing unit tests is one of the most disliked tasks for developers. The article lists 10 best practices for writing unit tests, explains the steps for writing unit tests manually, and finally introduces a method for automating test writing using Codium.AI.
A blog post from Netflix, introducing three testing strategies used during the safe migration of their mobile app from Falcor to GraphQL: A/B testing, Replay testing, and Sticky Canaries. A/B testing was used to assess the impact of the new feature on customers, Replay testing was used to verify the correctness of the migration, and Sticky Canaries were used to verify performance and business metrics.
🎁 Python Trending Weekly 🎁 organizes its content into seasons, with every 30 issues forming a season. The highlights from the first season have been compiled for your convenience. You can access them online here (Chinese).
A visual exploratory data analysis tool that runs in a Jupyter Notebook environment, generating an interactive graphical user interface with a single command, allowing for data exploration via drag-and-drop fields, similar to Tableau/PowerBI. (6.5k stars)
Write high-performance C extensions for Python in Julia, with a speedup of about 200x. (Submitted by @xgdgsc)
The official generative AI extension for JupyterLab, which mainly provides: %%ai directive, native chat UI page, and support for large language models across platforms (AI21, Anthropic, Cohere, Hugging Face, OpenAI, SageMaker, etc.).
A publisher-subscriber framework that supports synchronous and asynchronous scheduling, timed tasks, topic management, publisher-subscriber callbacks, and more. (Submitted by @Zeeland)
A disk-cached ORM framework that enables CRUD operations on basic and custom data types via ORM, supporting multiple serialization operations and data compression methods. (Submitted by @Zeeland)
How to test machine learning models, what issues to cover, and how to implement the tests? This framework scans for dozens of vulnerabilities (performance bias, data leakage, lack of robustness, spurious correlations, overconfidence, underconfidence, ethical issues, etc.) and generates domain-specific test suites based on the findings. (1K stars)
This week's hottest project, which can generate new images you want by dragging points on the image, is amazing! (star 28K)
In addition to a shell-like syntax and convenient shortcuts, this library provides local and remote command execution (via SSH), local and remote file system paths, easy directory and environment manipulation, and a programmable CLI toolkit. (2.6k stars)
Supports creating 3D content with text prompts, single images, and a small number of camera images. Supports a variety of models, such as ProlificDreamer, DreamFusion, Magic3D, Score Jacobian Chaining, and more. (1.8k stars)
Supports removing the background of an image with multiple usage methods (CLI, library, Docker) and a variety of powerful features. (10.5k stars)