Skip to content

Instantly share code, notes, and snippets.

View bitsnaps's full-sized avatar
🌍
Working @ CorpoSense

Ibrahim H. bitsnaps

🌍
Working @ CorpoSense
View GitHub Profile
@niklasmtj
niklasmtj / ci.yaml
Created March 7, 2024 13:12
Github Action that can be used for running CI tasks in Deno. Run tests, check code for formatting errors and lint the code base. Fails on found irregularities in tests, format (fmt) and linting
name: "CI"
on:
- pull_request
jobs:
ci:
runs-on: ubuntu-latest
steps:
- name: "Checkout"
@langecrew
langecrew / OAI_CONFIG_LIST
Created January 3, 2024 00:08
Autogen Autobuild
[
{
"model": "gpt-4",
"api_key": "PASTE_YOUR_API_KEY_HERE"
},
{
"model": "gpt-4-1106-preview",
"api_key": "PASTE_YOUR_API_KEY_HERE"
},
{
@langecrew
langecrew / OAI_CONFIG_LIST
Last active April 6, 2024 17:53
Taking the Autogen Teachable Agent one step further with some customization
[
{
"model": "gpt-4",
"api_key": "PASTE_YOUR_API_KEY_HERE"
},
{
"model": "gpt-4-1106-preview",
"api_key": "PASTE_YOUR_API_KEY_HERE"
},
{
import os
import autogen
import memgpt.autogen.memgpt_agent as memgpt_autogen
import memgpt.autogen.interface as autogen_interface
import memgpt.agent as agent
import memgpt.system as system
import memgpt.utils as utils
import memgpt.presets as presets
import memgpt.constants as constants
import memgpt.personas.personas as personas
@datasciencemonkey
datasciencemonkey / gptq_lora.py
Created September 13, 2023 21:57
train a gptq model using peft/lora
# %%
# this is run from /notebooks on paperspace
from huggingface_hub import login
from dotenv import load_dotenv
load_dotenv("/notebooks/.env")
import os
os.environ["TOKENIZERS_PARALLELISM"]="false"
login(token=os.getenv("HUGGINGFACE_TOKEN"))
@Sharktheone
Sharktheone / Arch-Mojo.md
Last active December 7, 2023 15:44
Install the new mojo programming language on Arch. This will be obsolete when mojo adds official Arch support.
@younesbelkada
younesbelkada / finetune_llama_v2.py
Last active April 16, 2024 18:01
Fine tune Llama v2 models on Guanaco Dataset
# 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
@sadasant
sadasant / _README.md
Last active August 30, 2023 17:33
Bash function for piping command outputs to OpenAI's GPT-4 model

This gpt() function reads input from the command line and then sends a formatted JSON object to the OpenAI API for the GPT-4 model. It properly escapes special characters and checks for the .env file containing the OpenAI API key.

Usage:

  • Load the function into your environment: source gpt.sh.
  • Make sure to have an .env file in the current directory with the OPENAI_API_KEY.
  • Pipe anything itno it, and also add a prompt, example:
git diff main | gpt "As a programmer, review this diff. Provide feedback only if necessary. Be brief"
@paolosalvatori
paolosalvatori / app.py
Last active December 11, 2023 13:29
A Streamlit chat written in Python and based on Azure OpenAI. The application was successfully tested on Azure Kubernetes Service (AKS)
"""
MIT License
Copyright (c) 2023 Paolo Salvatori
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, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
from flask import Flask, jsonify, request
import requests
import PyPDF2
import tempfile
import pickle
import retrying
from langchain.llms import OpenAI
from langchain.chains.qa_with_sources import load_qa_with_sources_chain
from langchain.docstore.document import Document
from langchain.embeddings.openai import OpenAIEmbeddings