Script to change git history VERY easily
curl 'https://raw.githubusercontent.com/erwanvivien/change_git_history/master/change_history.sh' > change_history.sh
chmod +x change_history.sh
# NB_commits defaults to 5| #!/Library/Frameworks/Python.framework/Versions/3.11/bin/python3 | |
| import pandas as pd | |
| from neo4j import GraphDatabase | |
| import yaml | |
| import datetime | |
| import sys | |
| import gzip | |
| from zipfile import ZipFile | |
| from urllib.parse import urlparse |
| from dotenv import dotenv_values | |
| from sqlalchemy import create_engine, Table | |
| from sqlalchemy.engine import Connection | |
| from sqlalchemy.schema import MetaData | |
| # Load the environment variables from the .env file | |
| cfg = dotenv_values(".env") | |
| # Connect to the source database | |
| engine_src = create_engine(cfg['src_database']) |
A schema layer harmoniously brings together the best of the flexibility ("anything goes!") of graph databases
and the "law and order" aspect of relational databases!
| # Based on younesbelkada/finetune_llama_v2.py | |
| # Install the following libraries: | |
| # pip install accelerate==0.21.0 peft==0.4.0 bitsandbytes==0.40.2 transformers==4.31.0 trl==0.4.7 scipy | |
| from dataclasses import dataclass, field | |
| from typing import Optional | |
| import torch | |
| from datasets import load_dataset | |
| from transformers import ( |
| """QA Chatbot streaming using FastAPI, LangChain Expression Language , OpenAI, and Chroma. | |
| Features | |
| -------- | |
| - Persistent Chat Memory: | |
| Stores chat history in a local file. | |
| - Persistent Vector Store: | |
| Stores document embeddings in a local vector store. | |
| - Standalone Question Generation: | |
| Rephrases follow-up questions to standalone questions in their original language. |
| class WorksheetDictWriter: | |
| """ | |
| Something like a `csv.DictWriter`, except for a `gspread.Worksheet` | |
| """ | |
| def __init__(self, worksheet: gspread.Worksheet, fieldnames: list[str], column="A"): | |
| self.fieldnames = fieldnames | |
| self.worksheet = worksheet | |
| self.column = column | |
| self.current_row = 1 |
| # coding=utf-8 | |
| # Copyright 2023 The HuggingFace Inc. team. All rights reserved. | |
| # | |
| # Licensed under the Apache License, Version 2.0 (the "License"); | |
| # you may not use this file except in compliance with the License. | |
| # You may obtain a copy of the License at | |
| # | |
| # http://www.apache.org/licenses/LICENSE-2.0 | |
| # | |
| # Unless required by applicable law or agreed to in writing, software |