A from-scratch walkthrough of what happens between typing a prompt and getting a response — no ML background assumed.
Every large language model — GPT-4, Claude, Gemini, Llama — is built on the same core idea. This guide follows that idea in the exact order data actually flows through a real model: text in, tokens, vectors, 80 stacked layers, and a word out — then loops back to explain how the model got trained in the first place. Read it top to bottom; each section is built to need only what came before it.
This file contains hidden or 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
| import asyncio | |
| import base64 | |
| import json | |
| import os | |
| import pyaudio | |
| from websockets.asyncio.client import connect | |
| class SimpleGeminiVoice: | |
| def __init__(self): |
This file contains hidden or 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
| import concurrent.futures | |
| from typing import Any, Callable, List | |
| from tqdm import tqdm | |
| def concurrent_task_executor(task: Callable[[Any], None], data_list: List[Any], max_workers: int = 32, description: str = None) -> None: | |
| """ | |
| Execute tasks concurrently on a list of data objects using ThreadPoolExecutor. | |
| Args: | |
| task (Callable): The function to apply to each data object. |
This file contains hidden or 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
| import autogen | |
| config_list = [ | |
| { | |
| 'model': 'gpt-4', | |
| 'api_key': 'API_KEY' | |
| } | |
| ] | |
| llm_config={ |
This file contains hidden or 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
| # main | |
| llama-index | |
| langchain |
How to get oobabooga/text-generation-webui running on Windows or Linux with LLaMa-30b 4bit mode via GPTQ-for-LLaMa on an RTX 3090 start to finish.
This guide actually works well for linux too. Just don't bother with the powershell envs
-
Download prerequisites
- Download and install miniconda
- (Windows Only) Download and install Visual Studio 2019 Build Tools
- Click on the latest BuildTools link, Select Desktop Environment with C++ when installing)
-
(Windows Only) Open the Conda Powershell.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or 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
| #! /usr/bin/python | |
| # 02/27/2015, Kenial | |
| # Just simple scripts for instant use of SQLAlchemy. | |
| import sqlalchemy as sa | |
| sa.__version__ # '0.9.4' for me | |
| # Sample DB connection string | |
| # engine = sa.create_engine('postgresql://scott:tiger@localhost/mydatabase') |
This file contains hidden or 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
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <meta charset="utf-8" /> | |
| <title>Remote terminal</title> | |
| <link rel="stylesheet" href="xterm.css" /> | |
| <script src="terminal.class.js"></script> | |
NewerOlder