Search is not available for this dataset
repo_id
stringlengths
12
110
file_path
stringlengths
24
164
content
stringlengths
3
89.3M
__index_level_0__
int64
0
0
public_repos/archive
public_repos/archive/community_meetings/community-2021-06-09.md
# 2021-06-09 NumPy Community Meeting Note: we now alternate between [triage meetings](https://hackmd.io/68i_JvOYQfy9ERiHgXMPvg) and community meetings. - Time: 20:00 UTC - Join via Zoom at https://berkeley.zoom.us/j/762261535 (or [dial-in](https://berkeley.zoom.us/u/aC3ENhycM)) - [Trello workboard](https://trello.com...
0
public_repos/archive
public_repos/archive/community_meetings/community-2022-02-02.md
# 2022–02-02 NumPy Community Meeting Note: we now alternate between [triage meetings](https://hackmd.io/68i_JvOYQfy9ERiHgXMPvg) and community meetings. - Time: 6:00 pm UTC - [Numpy community events calendar](https://calendar.google.com/calendar/r?cid=YmVya2VsZXkuZWR1X2lla2dwaWdtMjMyamJobGRzZmIyYzJqODFjQGdyb3VwLmNhbGV...
0
public_repos/archive
public_repos/archive/community_meetings/community-2022-03-16.md
# 2022–03-16 NumPy community meeting - Time: 6:00 pm UTC - [Numpy community events calendar](https://calendar.google.com/calendar/r?cid=YmVya2VsZXkuZWR1X2lla2dwaWdtMjMyamJobGRzZmIyYzJqODFjQGdyb3VwLmNhbGVuZGFyLmdvb2dsZS5jb20) - Join via Zoom at https://berkeley.zoom.us/j/762261535 (or [dial-in](https://berkeley.zoom.u...
0
public_repos/archive
public_repos/archive/community_meetings/community-2023-03-01.md
# 2023-03-01 NumPy community meeting - Time: 7:00 pm UTC - [NumPy community events calendar](https://scientific-python.org/calendars/) - Join via Zoom at https://us06web.zoom.us/j/83278611437?pwd=ekhoLzlHRjdWc0NOY2FQM0NPemdkZz09 (To dial in, find your local number: https://us06web.zoom.us/u/kbGQI0hHSd) - [Community m...
0
public_repos/archive
public_repos/archive/community_meetings/community-2022-11-23.md
# 2022-11-23 NumPy community meeting - Time: 7:00 pm UTC - [NumPy community events calendar](https://scientific-python.org/calendars/) - Join via Zoom at https://us06web.zoom.us/j/83278611437?pwd=ekhoLzlHRjdWc0NOY2FQM0NPemdkZz09 (To dial in, find your local number: https://us06web.zoom.us/u/kbGQI0hHSd) - [Community m...
0
public_repos/archive
public_repos/archive/community_meetings/community-2021-06-23.md
# 2021-06-23 NumPy Community Meeting Note: we now alternate between [triage meetings](https://hackmd.io/68i_JvOYQfy9ERiHgXMPvg) and community meetings. - Time: 20:00 UTC - Join via Zoom at https://berkeley.zoom.us/j/762261535 (or [dial-in](https://berkeley.zoom.us/u/aC3ENhycM)) - [Trello workboard](https://trello.com...
0
public_repos/archive
public_repos/archive/community_meetings/community-2021-03-31.md
# 2021-03-31 NumPy Community Meeting Note: we now alternate between [triage meetings](https://hackmd.io/68i_JvOYQfy9ERiHgXMPvg) and community meetings. - Time: 20:00 UTC - Join via Zoom at https://berkeley.zoom.us/j/762261535 (or [dial-in](https://berkeley.zoom.us/u/aC3ENhycM)) - [Trello workboard](https://trello.com...
0
public_repos/archive
public_repos/archive/community_meetings/community-2021-02-17.md
--- tags: NumPy --- # 2021-02-17 NumPy Community Meeting Note: we now alternate between [triage meetings](https://hackmd.io/68i_JvOYQfy9ERiHgXMPvg) and community meetings. - Time: 12:00 Pacific Time (20:00 UTC) - Join via Zoom at https://berkeley.zoom.us/j/762261535 (or [dial-in](https://berkeley.zoom.us/u/aC3ENhyc...
0
public_repos/archive
public_repos/archive/community_meetings/community-2020-05-27.md
--- tags: NumPy --- # 2020-05-27 NumPy Community Meeting Note: we now alternate between [triage meetings](https://hackmd.io/68i_JvOYQfy9ERiHgXMPvg) and community meetings. - Time: 13:00 Pacific Time - Join via Zoom at https://berkeley.zoom.us/j/762261535 (or [dial-in](https://berkeley.zoom.us/u/aC3ENhycM)) - [Trello...
0
public_repos/archive
public_repos/archive/community_meetings/community-2023-09-13.md
# 2023-09-13 NumPy community meeting - Time: 5:00pm UTC - [NumPy community events calendar](https://scientific-python.org/calendars/) - Join via Zoom at https://numfocus-org.zoom.us/j/83278611437?pwd=ekhoLzlHRjdWc0NOY2FQM0NPemdkZz09 (To dial in, find your local number: https://numfocus-org.zoom.us/u/kekDGNWmRa.) - [Co...
0
public_repos/archive
public_repos/archive/community_meetings/community-2023-06-07.md
--- tags: NumPy --- # 2023-06-07 NumPy community meeting - Time: 5:00pm UTC - [NumPy community events calendar](https://scientific-python.org/calendars/) - Join via Zoom at https://us06web.zoom.us/j/83278611437?pwd=ekhoLzlHRjdWc0NOY2FQM0NPemdkZz09 (To dial in, find your local number: https://us06web.zoom.us/u/kbGQI0h...
0
public_repos/archive
public_repos/archive/community_meetings/community-2021-03-03.md
--- tags: NumPy --- # 2021-03-03 NumPy Community Meeting Note: we now alternate between [triage meetings](https://hackmd.io/68i_JvOYQfy9ERiHgXMPvg) and community meetings. - Time: 12:00 Pacific Time (20:00 UTC) - Join via Zoom at https://berkeley.zoom.us/j/762261535 (or [dial-in](https://berkeley.zoom.us/u/aC3ENhyc...
0
public_repos/archive
public_repos/archive/community_meetings/community-2021-04-28.md
--- tags: NumPy --- # 2021-04-28 NumPy Community Meeting Note: we now alternate between [triage meetings](https://hackmd.io/68i_JvOYQfy9ERiHgXMPvg) and community meetings. - Time: 20:00 UTC - Join via Zoom at https://berkeley.zoom.us/j/762261535 (or [dial-in](https://berkeley.zoom.us/u/aC3ENhycM)) - [Trello workboa...
0
public_repos/archive
public_repos/archive/community_meetings/community-2020-01-22.md
--- tags: NumPy --- # 2020-01-22 NumPy Community Meeting Note: we now alternate between [triage meetings](https://hackmd.io/68i_JvOYQfy9ERiHgXMPvg) and community meetings. - Time: 11am Pacific Time - Join via Zoom at https://berkeley.zoom.us/j/762261535 (or [dial-in](https://berkeley.zoom.us/u/aC3ENhycM)) - [Trello ...
0
public_repos/archive
public_repos/archive/community_meetings/community-2020-08-19.md
--- tags: NumPy --- # 2020-08-19 NumPy Community Meeting Note: we now alternate between [triage meetings](https://hackmd.io/68i_JvOYQfy9ERiHgXMPvg) and community meetings. - Time: 13:00 Pacific Time (18:00 UTC) - Join via Zoom at https://berkeley.zoom.us/j/762261535 (or [dial-in](https://berkeley.zoom.us/u/aC3ENhycM...
0
public_repos/archive
public_repos/archive/community_meetings/community-2020-07-22.md
--- tags: NumPy --- # 2020-07-22 NumPy Community Meeting Note: we now alternate between [triage meetings](https://hackmd.io/68i_JvOYQfy9ERiHgXMPvg) and community meetings. - Time: 13:00 Pacific Time (18:00 UTC) - Join via Zoom at https://berkeley.zoom.us/j/762261535 (or [dial-in](https://berkeley.zoom.us/u/aC3ENhycM...
0
public_repos/archive
public_repos/archive/community_meetings/community-2023-08-16.md
# 2023-08-16 NumPy community meeting - Time: 5:00pm UTC - [NumPy community events calendar](https://scientific-python.org/calendars/) - Join via Zoom at https://numfocus-org.zoom.us/j/83278611437?pwd=ekhoLzlHRjdWc0NOY2FQM0NPemdkZz09 (To dial in, find your local number: https://numfocus-org.zoom.us/u/kekDGNWmRa.) - [Co...
0
public_repos/archive
public_repos/archive/web_team_meetings/webteam-2020-02-18.md
# 2020-02-18 NumPy Web Team Meeting Time: 1:00 PM PST/ 4:00 PM EST Join Hangouts Meet: meet.google.com/wex-fwsf-dtc <br> **note: Hangouts works best with Chrome* Join by phone: +1 651-504-5687‬ PIN: ‪950 133 744‬# [Slack workspace](https://numpy-team.slack.com) [Meetings archive](https://github.com/numpy/archive/t...
0
public_repos/archive
public_repos/archive/web_team_meetings/webteam-2019-10-28.md
# 2019-10-28 NumPy Web Team Meeting Time: 9:00 AM PST Join Hangouts Meet: https://meet.google.com/trm-gvto-guz <br> **note: Hangouts works best with Chrome* Join by phone: +1 980-533-5653 PIN: 455 016 082# [Slack workspace](https://numpy-team.slack.com) [Meetings archive](https://github.com/numpy/archive/tree/mast...
0
public_repos/archive
public_repos/archive/web_team_meetings/webteam-2020-02-20.md
# 2020-02-20 NumPy Web Team Meeting Time: 5:00 PM PST Join Hangouts Meet: meet.google.com/usa-owrj-gjt <br> **note: Hangouts works best with Chrome* Join by phone: https://meet.google.com/tel/usa-owrj-gjt?pin=5379071568271 [Slack workspace](https://numpy-team.slack.com) [Meetings archive](https://github.com/numpy/...
0
public_repos/archive
public_repos/archive/web_team_meetings/webteam-2019-08-17.md
# 2019-08-17 NumPy Web Team Meeting **Present:** Ralf, Inessa, Joe, Shekhar # Agenda 1. Outline major project milestones. 2. Decide on project management tool. 3. Define project organization. 4. Decide on website generator. 5. Discuss deployment strategies. 6. Explore further translation options. # Minutes Int...
0
public_repos/archive
public_repos/archive/web_team_meetings/webteam-2019-09-23.md
# 2019-09-23 NumPy Web Team Meeting **Present:** Ralf, Inessa, Joe, Matti, Sebastian, Hameer # Agenda 1. Status of the `newsite` branch. 2. Website structure - site map: https://app.flowmapp.com/share/e1b61759a5f95f43d8907baedf42875d/ 3. Status of content creation. 4. Status of translations with Crowdin. 5. GitHub...
0
public_repos/archive
public_repos/archive/web_team_meetings/webteam-2019-12-10.md
# 2019-12-10 NumPy Web Team Meeting Time: 9:00 PM IST / 7:30 AM PST Join Hangouts Meet: meet.google.com/axt-ezae-tms <br> **note: Hangouts works best with Chrome* Join by phone: +1 929-336-0281‬ PIN: ‪416 898 831‬# [Slack workspace](https://numpy-team.slack.com) [Meetings archive](https://github.com/numpy/archive/...
0
public_repos
public_repos/chat-langchain/Procfile
# Modify this Procfile to fit your needs web: uvicorn main:app --host 0.0.0.0 --port 8080
0
public_repos
public_repos/chat-langchain/poetry.lock
# This file is automatically @generated by Poetry 1.5.1 and should not be changed by hand. [[package]] name = "aiohttp" version = "3.8.6" description = "Async http client/server framework (asyncio)" optional = false python-versions = ">=3.6" files = [ {file = "aiohttp-3.8.6-cp310-cp310-macosx_10_9_universal2.whl",...
0
public_repos
public_repos/chat-langchain/yarn.lock
# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. # yarn lockfile v1 "@babel/code-frame@^7.0.0": version "7.22.13" resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.22.13.tgz#e3c1c099402598483b7a8c46a721d1038803755e" integrity sha512-XktuhWlJ5g+3TJXc5upd9Ks1HutSArik6jf2eAjYF...
0
public_repos
public_repos/chat-langchain/.dockerignore
chat-langchain/ assets/
0
public_repos
public_repos/chat-langchain/main.py
"""Main entrypoint for the app.""" import asyncio import os from operator import itemgetter from typing import Dict, List, Optional, Sequence, Union from uuid import UUID import langsmith import weaviate from fastapi import FastAPI from fastapi.middleware.cors import CORSMiddleware from langchain.chat_models import Ch...
0
public_repos
public_repos/chat-langchain/constants.py
WEAVIATE_DOCS_INDEX_NAME = "LangChain_agent_docs"
0
public_repos
public_repos/chat-langchain/Makefile
.PHONY: start start: uvicorn main:app --reload --port 8080 .PHONY: format format: black . isort .
0
public_repos
public_repos/chat-langchain/parser.py
import re from typing import Generator from bs4 import BeautifulSoup, Doctype, NavigableString, Tag def langchain_docs_extractor(soup: BeautifulSoup) -> str: # Remove all the tags that are not meaningful for the extraction. SCAPE_TAGS = ["nav", "footer", "aside", "script", "style"] [tag.decompose() for t...
0
public_repos
public_repos/chat-langchain/Dockerfile
FROM python:3.11-buster RUN pip install poetry==1.5.1 RUN poetry config virtualenvs.create false COPY ./pyproject.toml ./poetry.lock* ./ RUN poetry install --no-interaction --no-ansi --no-root --no-directory COPY ./*.py ./ RUN poetry install --no-interaction --no-ansi CMD exec uvicorn main:app --host 0.0.0.0 --...
0
public_repos
public_repos/chat-langchain/pyproject.toml
[tool.poetry] name = "chat-langchain" version = "0.1.0" description = "" authors = ["SN <6432132+samnoyes@users.noreply.github.com>"] readme = "README.md" [tool.poetry.dependencies] python = "^3.10" openai = "^0.28.0" fastapi = "^0.103.1" pydantic = "1.10" langchain = "^0.0.331" uvicorn = "^0.23.2" beautifulsoup4 = "^...
0
public_repos
public_repos/chat-langchain/README.md
# 🦜️🔗 Chat LangChain This repo is an implementation of a locally hosted chatbot specifically focused on question answering over the [LangChain documentation](https://langchain.readthedocs.io/en/latest/). Built with [LangChain](https://github.com/hwchase17/langchain/), [FastAPI](https://fastapi.tiangolo.com/), and [N...
0
public_repos
public_repos/chat-langchain/LICENSE
MIT License Copyright (c) 2023 Harrison Chase Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, di...
0
public_repos
public_repos/chat-langchain/ingest.py
"""Load html from files, clean up, split, ingest into Weaviate.""" import logging import os import re from parser import langchain_docs_extractor import weaviate from bs4 import BeautifulSoup, SoupStrainer from langchain.document_loaders import RecursiveUrlLoader, SitemapLoader from langchain.embeddings import OpenAIE...
0
public_repos/chat-langchain
public_repos/chat-langchain/terraform/backend.tf
terraform { backend "gcs" { bucket = "YOUR BUCKET" prefix = "YOUR PREFIX" } }
0
public_repos/chat-langchain
public_repos/chat-langchain/terraform/main.tf
locals { secret_json = jsondecode(data.google_secret_manager_secret_version.chat_langchain_backend_secrets.secret_data) region = "YOUR REGION" project_id = "YOUR PROJECT ID" } provider "google" { project = local.project_id region = local.region } # Load secrets from Secret Manager. You can specify yo...
0
public_repos/chat-langchain/terraform/modules
public_repos/chat-langchain/terraform/modules/chat_langchain_backend/main.tf
# Common environment variables locals { voyager_vars = var.voyage_ai_model != "" && var.voyage_api_key != "" ? { VOYAGE_AI_MODEL = var.voyage_ai_model VOYAGE_API_KEY = var.voyage_api_key } : {} env_vars = merge(local.voyager_vars, { OPENAI_API_KEY = var.openai_api_key WEAVIATE_URL =...
0
public_repos/chat-langchain/terraform/modules
public_repos/chat-langchain/terraform/modules/chat_langchain_backend/variables.tf
variable "chat_langchain_backend_name" { description = "Name to use for resources that will be created" type = string } variable "project_id" { description = "The ID of the project" type = string } variable "region" { description = "The region to deploy to" type = string } variable "...
0
public_repos/chat-langchain
public_repos/chat-langchain/_scripts/clear_index.py
"""Clear Weaviate index.""" import logging import os import weaviate from langchain.embeddings import OpenAIEmbeddings from langchain.indexes import SQLRecordManager, index from langchain.vectorstores import Weaviate logger = logging.getLogger(__name__) WEAVIATE_URL = os.environ["WEAVIATE_URL"] WEAVIATE_API_KEY = os...
0
public_repos/chat-langchain
public_repos/chat-langchain/_scripts/evaluate_chains_agent.py
import argparse import json import os from typing import Optional import weaviate from langchain import load as langchain_load from langchain.agents import AgentExecutor, Tool from langchain.agents.openai_functions_agent.agent_token_buffer_memory import ( AgentTokenBufferMemory, ) from langchain.agents.openai_func...
0
public_repos/chat-langchain
public_repos/chat-langchain/_scripts/evaluate_chat_langchain.py
# TODO: Consolidate all these scripts into a single script # This is ugly import argparse from langchain.chat_models import ChatAnthropic, ChatOpenAI from langchain.smith import RunEvalConfig from langsmith import Client # Ugly. Requires PYTHONATH=$(PWD) to run from main import create_chain, get_retriever _PROVIDER_...
0
public_repos/chat-langchain
public_repos/chat-langchain/_scripts/evaluate_chains_improved_chain.py
import argparse import datetime import functools import json import os from typing import Literal, Optional, Union import weaviate from langchain import load as langchain_load from langchain.chat_models import ChatAnthropic, ChatOpenAI from langchain.embeddings import OpenAIEmbeddings from langchain.output_parsers imp...
0
public_repos/chat-langchain
public_repos/chat-langchain/_scripts/evaluate_chains.py
import argparse import functools import json import os from operator import itemgetter from typing import Literal, Optional, Union import weaviate from langchain import load as langchain_load from langchain.chat_models import ChatAnthropic, ChatOpenAI from langchain.embeddings import OpenAIEmbeddings from langchain.pr...
0
public_repos/chat-langchain
public_repos/chat-langchain/chat-langchain/vercel.json
{ "git": { "deploymentEnabled": { "main": false } } }
0
public_repos/chat-langchain
public_repos/chat-langchain/chat-langchain/yarn.lock
# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. # yarn lockfile v1 "@aashutoshrathi/word-wrap@^1.2.3": version "1.2.6" resolved "https://registry.yarnpkg.com/@aashutoshrathi/word-wrap/-/word-wrap-1.2.6.tgz#bd9154aec9983f77b3a034ecaa015c2e4201f6cf" integrity sha512-1Yjs2SvM8TflER/OD3cOjhWWOZb58A...
0
public_repos/chat-langchain
public_repos/chat-langchain/chat-langchain/.eslintrc.json
{ "extends": "next/core-web-vitals" }
0
public_repos/chat-langchain
public_repos/chat-langchain/chat-langchain/tailwind.config.ts
import type { Config } from "tailwindcss"; const config: Config = { content: [ "./pages/**/*.{js,ts,jsx,tsx,mdx}", "./components/**/*.{js,ts,jsx,tsx,mdx}", "./app/**/*.{js,ts,jsx,tsx,mdx}", ], theme: { extend: { backgroundImage: { "gradient-radial": "radial-gradient(var(--tw-gradien...
0
public_repos/chat-langchain
public_repos/chat-langchain/chat-langchain/.prettierrc
{ "endOfLine": "lf" }
0
public_repos/chat-langchain
public_repos/chat-langchain/chat-langchain/tsconfig.json
{ "compilerOptions": { "target": "es5", "lib": ["dom", "dom.iterable", "esnext"], "allowJs": true, "skipLibCheck": true, "strict": true, "forceConsistentCasingInFileNames": true, "noEmit": true, "esModuleInterop": true, "module": "esnext", "moduleResolution": "bundler", "re...
0
public_repos/chat-langchain
public_repos/chat-langchain/chat-langchain/postcss.config.js
module.exports = { plugins: { tailwindcss: {}, autoprefixer: {}, }, };
0
public_repos/chat-langchain
public_repos/chat-langchain/chat-langchain/.env.example
## For JS backend: # LANGCHAIN_TRACING_V2=true # LANGCHAIN_ENDPOINT="https://api.smith.langchain.com" # LANGCHAIN_API_KEY="YOUR_LANGSMITH_KEY" # LANGCHAIN_PROJECT="YOUR_PROJECT_NAME" # NEXT_PUBLIC_API_BASE_URL="http://localhost:3000/api" # OPENAI_API_KEY="YOUR_OPENAI_API_KEY" # WEAVIATE_HOST="YOUR_WEAVIATE_HOST" # WE...
0
public_repos/chat-langchain
public_repos/chat-langchain/chat-langchain/next.config.js
/** @type {import('next').NextConfig} */ const nextConfig = {}; module.exports = nextConfig;
0
public_repos/chat-langchain
public_repos/chat-langchain/chat-langchain/package.json
{ "name": "chat-langchain", "version": "0.1.0", "private": true, "packageManager": "yarn@1.22.19", "scripts": { "dev": "next dev", "build": "next build", "start": "next start", "lint": "next lint", "format": "prettier --write ." }, "dependencies": { "@chakra-ui/icons": "^2.1.0", ...
0
public_repos/chat-langchain/chat-langchain
public_repos/chat-langchain/chat-langchain/app/layout.tsx
import "./globals.css"; import type { Metadata } from "next"; import { Inter } from "next/font/google"; const inter = Inter({ subsets: ["latin"] }); export const metadata: Metadata = { title: "Chat LangChain", description: "Chatbot for LangChain", }; export default function RootLayout({ children, }: { childr...
0
public_repos/chat-langchain/chat-langchain
public_repos/chat-langchain/chat-langchain/app/page.tsx
"use client"; import { ChatWindow } from "../app/components/ChatWindow"; import { ToastContainer } from "react-toastify"; import { ChakraProvider } from "@chakra-ui/react"; export default function Home() { return ( <ChakraProvider> <ToastContainer /> <ChatWindow titleText="Chat LangChain 🦜...
0
public_repos/chat-langchain/chat-langchain
public_repos/chat-langchain/chat-langchain/app/globals.css
@tailwind base; @tailwind components; @tailwind utilities; body { color: #f8f8f8; background: #131318; } body input, body textarea { color: black; } a { color: #2d7bd4; } a:hover { border-bottom: 1px solid; } p { margin: 8px 0; } code { color: #ffa500; } li { padding: 4px; }
0
public_repos/chat-langchain/chat-langchain/app
public_repos/chat-langchain/chat-langchain/app/utils/sendFeedback.tsx
import { v4 as uuidv4 } from "uuid"; import { apiBaseUrl } from "./constants"; type SendFeedbackProps = { key: string; runId: string; score?: number; value?: string; comment?: string; feedbackId?: string; isExplicit: boolean; }; type FeedbackResponse = { feedbackId: string; code: number; result: s...
0
public_repos/chat-langchain/chat-langchain/app
public_repos/chat-langchain/chat-langchain/app/utils/constants.tsx
export const apiBaseUrl = process.env.NEXT_PUBLIC_API_BASE_URL ?? "http://localhost:8080";
0
public_repos/chat-langchain/chat-langchain/app
public_repos/chat-langchain/chat-langchain/app/components/InlineCitation.tsx
import { Source } from "./SourceBubble"; export function InlineCitation(props: { source: Source; sourceNumber: number; highlighted: boolean; onMouseEnter: () => any; onMouseLeave: () => any; }) { const { source, sourceNumber, highlighted, onMouseEnter, onMouseLeave } = props; return ( <a hr...
0
public_repos/chat-langchain/chat-langchain/app
public_repos/chat-langchain/chat-langchain/app/components/EmptyState.tsx
import { MouseEvent } from "react"; import { Heading, Link, Card, CardHeader, Flex, Spacer, } from "@chakra-ui/react"; export function EmptyState(props: { onChoice: (question: string) => any }) { const handleClick = (e: MouseEvent) => { props.onChoice((e.target as HTMLDivElement).innerText); }; r...
0
public_repos/chat-langchain/chat-langchain/app
public_repos/chat-langchain/chat-langchain/app/components/ChatMessageBubble.tsx
import { toast } from "react-toastify"; import "react-toastify/dist/ReactToastify.css"; import { emojisplosion } from "emojisplosion"; import { useState, useRef } from "react"; import { SourceBubble, Source } from "./SourceBubble"; import { VStack, Flex, Heading, HStack, Box, Button, Divider, Spacer, } ...
0
public_repos/chat-langchain/chat-langchain/app
public_repos/chat-langchain/chat-langchain/app/components/AutoResizeTextarea.tsx
import { Textarea, TextareaProps } from "@chakra-ui/react"; import ResizeTextarea from "react-textarea-autosize"; import React from "react"; interface ResizeTextareaProps { maxRows?: number; } const ResizableTextarea: React.FC<ResizeTextareaProps> = ({ maxRows, ...props }) => { return <ResizeTextarea maxRows=...
0
public_repos/chat-langchain/chat-langchain/app
public_repos/chat-langchain/chat-langchain/app/components/ChatWindow.tsx
"use client"; import React, { useRef, useState } from "react"; import { v4 as uuidv4 } from "uuid"; import { EmptyState } from "../components/EmptyState"; import { ChatMessageBubble, Message } from "../components/ChatMessageBubble"; import { AutoResizeTextarea } from "./AutoResizeTextarea"; import { marked } from "mar...
0
public_repos/chat-langchain/chat-langchain/app
public_repos/chat-langchain/chat-langchain/app/components/SourceBubble.tsx
import "react-toastify/dist/ReactToastify.css"; import { Card, CardBody, Heading } from "@chakra-ui/react"; import { sendFeedback } from "../utils/sendFeedback"; export type Source = { url: string; title: string; }; export function SourceBubble({ source, highlighted, onMouseEnter, onMouseLeave, runId, }...
0
public_repos/chat-langchain/chat-langchain/app/api
public_repos/chat-langchain/chat-langchain/app/api/get_trace/route.ts
// JS backend not used by default, see README for instructions. import { NextRequest, NextResponse } from "next/server"; import { Client } from "langsmith"; export const runtime = "edge"; const client = new Client(); const pollForRun = async (runId: string, retryCount = 0): Promise<string> => { await new Promise...
0
public_repos/chat-langchain/chat-langchain/app/api
public_repos/chat-langchain/chat-langchain/app/api/feedback/route.ts
// JS backend not used by default, see README for instructions. import { NextRequest, NextResponse } from "next/server"; import { Client } from "langsmith"; export const runtime = "edge"; const client = new Client(); export async function POST(req: NextRequest) { try { const body = await req.json(); cons...
0
public_repos/chat-langchain/chat-langchain/app/api/chat
public_repos/chat-langchain/chat-langchain/app/api/chat/stream_log/route.ts
// JS backend not used by default, see README for instructions. import { NextRequest, NextResponse } from "next/server"; import type { BaseLanguageModel } from "langchain/base_language"; import type { Document } from "langchain/document"; import { Runnable, RunnableSequence, RunnableMap, RunnableBranch, Ru...
0
public_repos/chat-langchain/chat-langchain/public
public_repos/chat-langchain/chat-langchain/public/images/github-mark.svg
<svg width="98" height="96" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" d="M48.854 0C21.839 0 0 22 0 49.217c0 21.756 13.993 40.172 33.405 46.69 2.427.49 3.316-1.059 3.316-2.362 0-1.141-.08-5.052-.08-9.127-13.59 2.934-16.42-5.867-16.42-5.867-2.184-5.704-5.42-7.17-5.42-7.17-4.448-3.01...
0
public_repos
public_repos/lit-llama/generate.py
import sys import time import warnings from pathlib import Path from typing import Optional import lightning as L import torch # support running without installing as a package wd = Path(__file__).parent.parent.resolve() sys.path.append(str(wd)) from lit_llama import LLaMA, Tokenizer from lit_llama.utils import lazy...
0
public_repos
public_repos/lit-llama/setup.py
import os from setuptools import setup, find_packages _PATH_ROOT = os.path.dirname(__file__) with open(os.path.join(_PATH_ROOT, "README.md"), encoding="utf-8") as fo: readme = fo.read() setup( name='lit-llama', version='0.1.0', description='Implementation of the LLaMA language model', author='L...
0
public_repos
public_repos/lit-llama/requirements.txt
torch>=2.0.0 lightning @ git+https://github.com/Lightning-AI/lightning@master sentencepiece tqdm # convert_checkpoint.py numpy # train.py dataset memmap jsonargparse[signatures] # generate.py, convert_checkpoint.py CLI bitsandbytes # quantization.py datasets # evaluate.py zstandard # prepare_redpajama.py
0
public_repos
public_repos/lit-llama/README.md
<div align="center"> <img src="https://pl-public-data.s3.amazonaws.com/assets_lightning/Lit_LLaMA_Badge3x.png" alt="Lit-LLaMA" width="128"/> # ⚡ Lit-LLaMA ️ <!-- <p align="center"> <a href="https://www.lightning.ai/">Lightning.ai</a> • <a href="https://lightning.ai/docs/pytorch/stable/">PyTorch Lightning</a> • ...
0
public_repos
public_repos/lit-llama/LICENSE
Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 1. Definitions. "License" shall mean the terms and conditions for use, reproduction, ...
0
public_repos/lit-llama
public_repos/lit-llama/pretrain/shakespeare.py
""" This script is a placeholder for training LLaMA from scratch. Currently, it just trains on the Shakespeare dataset. """ from pathlib import Path import sys import os import time from functools import partial from typing import Tuple import lightning as L from lightning.fabric.strategies import FSDPStrategy import...
0
public_repos/lit-llama
public_repos/lit-llama/pretrain/redpajama.py
import os import sys import math import glob import time from functools import partial from pathlib import Path from typing import Tuple, Optional import lightning as L from lightning.fabric.strategies import FSDPStrategy import torch from torch.utils.data import DataLoader from torch.distributed.fsdp.wrap import tra...
0
public_repos/lit-llama
public_repos/lit-llama/evaluate/full.py
# This mimics GPTQ's evaluation metrics: https://github.com/IST-DASLab/gptq/ # Thanks to E. Frantar et al GPTQ: Accurate Post-training Compression for GPT, arXiv:2210.17323 import math import sys import time from pathlib import Path from typing import Optional import lightning as L import torch import tqdm # support ...
0
public_repos/lit-llama
public_repos/lit-llama/evaluate/adapter_v2.py
# This mimics GPTQ's evaluation metrics: https://github.com/IST-DASLab/gptq/ # Thanks to E. Frantar et al GPTQ: Accurate Post-training Compression for GPT, arXiv:2210.17323 import math import sys import time from pathlib import Path from typing import Optional import lightning as L import torch import tqdm # support ...
0
public_repos/lit-llama
public_repos/lit-llama/evaluate/lora.py
# This mimics GPTQ's evaluation metrics: https://github.com/IST-DASLab/gptq/ # Thanks to E. Frantar et al GPTQ: Accurate Post-training Compression for GPT, arXiv:2210.17323 import math import sys import time from pathlib import Path from typing import Optional import lightning as L import torch import tqdm # support ...
0
public_repos/lit-llama
public_repos/lit-llama/evaluate/adapter.py
# This mimics GPTQ's evaluation metrics: https://github.com/IST-DASLab/gptq/ # Thanks to E. Frantar et al GPTQ: Accurate Post-training Compression for GPT, arXiv:2210.17323 import math import sys import time from pathlib import Path from typing import Optional import lightning as L import torch import tqdm # support ...
0
public_repos/lit-llama
public_repos/lit-llama/lit_llama/model.py
"""Full definition of a LLaMA Language Model, all of it in this single file. Based on the nanoGPT implementation: https://github.com/karpathy/nanoGPT. """ # mypy: ignore-errors import math from dataclasses import dataclass from typing import List, Optional, Tuple, Union import torch import torch.nn as nn from torch.n...
0
public_repos/lit-llama
public_repos/lit-llama/lit_llama/packed_dataset.py
# Very loosely inspired by indexed_dataset in Fairseq, Megatron # https://github.com/NVIDIA/Megatron-LM/blob/main/megatron/data/indexed_dataset.py import os import struct import random import numpy as np import torch from torch.utils.data import IterableDataset, get_worker_info dtypes = { 1: np.uint8, 2: n...
0
public_repos/lit-llama
public_repos/lit-llama/lit_llama/adapter_v2.py
import torch from torch import Tensor import torch.nn as nn from torch.nn import functional as F from lit_llama.adapter import LLaMA def get_adapter_substrings(): substrings = ["adapter_wte", "gating_factor"] # regular adapter v1 parameters substrings.extend(["adapter_scale", "adapter_bias"]) # adapter v2:...
0
public_repos/lit-llama
public_repos/lit-llama/lit_llama/lora.py
# Derived from https://github.com/microsoft/LoRA # ------------------------------------------------------------------------------------------ # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License (MIT). See LICENSE in the repo root for license information. # ------------------...
0
public_repos/lit-llama
public_repos/lit-llama/lit_llama/quantization.py
import os from contextlib import contextmanager import warnings import math import torch # configuration for bitsandbytes before import os.environ["BITSANDBYTES_NOWELCOME"] = "1" warnings.filterwarnings( "ignore", message="MatMul8bitLt: inputs will be cast from torch.float32 to float16 during quantization", )...
0
public_repos/lit-llama
public_repos/lit-llama/lit_llama/utils.py
"""Utility functions for training and inference.""" import functools import pickle import warnings from io import BytesIO from pathlib import Path from contextlib import contextmanager import torch import torch.utils._device from lightning.fabric.strategies import DeepSpeedStrategy, FSDPStrategy from torch.distribute...
0
public_repos/lit-llama
public_repos/lit-llama/lit_llama/adapter.py
"""Implementation of the paper: LLaMA-Adapter: Efficient Fine-tuning of Language Models with Zero-init Attention https://arxiv.org/abs/2303.16199 | Prefix cross-attention ...
0
public_repos/lit-llama
public_repos/lit-llama/lit_llama/tokenizer.py
import os from pathlib import Path from typing import Optional import torch from sentencepiece import SentencePieceProcessor, SentencePieceTrainer class Tokenizer: """Tokenizer for LLaMA.""" def __init__(self, model_path: Path) -> None: self.processor = SentencePieceProcessor(model_file=str(model_pa...
0
public_repos/lit-llama
public_repos/lit-llama/lit_llama/__init__.py
from lit_llama.model import LLaMAConfig, LLaMA, RMSNorm, build_rope_cache, apply_rope from lit_llama.tokenizer import Tokenizer
0
public_repos/lit-llama
public_repos/lit-llama/howto/unstructured_dataset.md
# Finetuning on an unstructured dataset While most scripts were made to finetune on instruction datasets, it is possible to finetune on any dataset. This is useful for experimentation while not being as expensive as training a full model. This guide is only to prepare the finetuning, as either LoRA or Adapter-v1 meth...
0
public_repos/lit-llama
public_repos/lit-llama/howto/finetune_full.md
# Full Finetuning Full finetuning updates all layers in the pretrained LLaMA model. This *regular* finetuning procedure is typically considered as the baseline for parameter-efficient alternatives such as Low-Rank Adaptation (LoRA) or LLaMA-Adapter. The current [finetune/full.py](../finetune/full.py) we provide uses...
0
public_repos/lit-llama
public_repos/lit-llama/howto/tpus.md
# TPU support Lit-LLaMA used `lightning.Fabric` under the hood, which itself supports TPUs (via [PyTorch XLA](https://github.com/pytorch/xla)). The following commands will allow you to set up a `Google Cloud` instance with a [TPU v4](https://cloud.google.com/tpu/docs/system-architecture-tpu-vm) VM: ```shell gcloud c...
0
public_repos/lit-llama
public_repos/lit-llama/howto/finetune_lora.md
# Finetuning with LoRA [Low-rank adaption (LoRA)](https://arxiv.org/abs/2106.09685) is a technique to approximate the update to the linear layers in a LLM with a low-rank matrix factorization. This significantly reduces the number of trainable parameters and speeds up training with little impact on the final performan...
0
public_repos/lit-llama
public_repos/lit-llama/howto/inference.md
# Inference We demonstrate how to run inference (next token prediction) with the LLaMA base model in the [`generate.py`](generate.py) script: ```bash python generate.py --prompt "Hello, my name is" ``` Output: ``` Hello my name is TJ. I have a passion for the outdoors, love hiking and exploring. I also enjoy travelin...
0
public_repos/lit-llama
public_repos/lit-llama/howto/train_redpajama.md
# Pre-train LLaMA on RedPajama This howto will walk you through setting up the RedPajama dataset and launching the pre-training script. ## What's RedPajama [RedPajama](https://github.com/togethercomputer/RedPajama-Data) is an open-source reproduction of the original LLaMA training dataset. It contains a total of 1....
0
public_repos/lit-llama
public_repos/lit-llama/howto/finetune_adapter_v2.md
# Finetuning with Adapter v2 [LLaMA-Adapter v2](https://arxiv.org/abs/2304.15010) is a form of prefix-tuning that prepends a learnable adaption-prompt to the inputs of the attention blocks in LLaMA. In total, there are only ~4 M parameters to update during finetuning, which significantly reduces the memory footprint a...
0
public_repos/lit-llama
public_repos/lit-llama/howto/finetune_adapter.md
# Finetuning with Adapter [LLaMA-Adapter](https://arxiv.org/abs/2303.16199) is a form of prefix-tuning that prepends a learnable adaption-prompt to the inputs of the attention blocks in LLaMA. In total, there are only 1.2M parameters to update during finetuning, which significantly reduces the memory footprint and spe...
0
public_repos/lit-llama
public_repos/lit-llama/howto/download_weights.md
## Downloading pretrained weights Except for when you are training from scratch, you will need the pretrained weights from Meta. ### Original Meta weights Download the model weights following the instructions on the official [LLaMA repository](https://github.com/facebookresearch/llama). Once downloaded, you should ...
0
public_repos/lit-llama
public_repos/lit-llama/howto/customize_paths.md
## Customize paths The project is setup to use specific paths to read the original weights and save checkpoints etc. For all scripts, you can run ```shell python script.py -h ``` to get a list of available options. For instance, here's how you would modify the checkpoint dir: ```shell python scripts/convert_checkp...
0