This file contains 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
name: "CI" | |
on: | |
- pull_request | |
jobs: | |
ci: | |
runs-on: ubuntu-latest | |
steps: | |
- name: "Checkout" |
This file contains 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
[ | |
{ | |
"model": "gpt-4", | |
"api_key": "PASTE_YOUR_API_KEY_HERE" | |
}, | |
{ | |
"model": "gpt-4-1106-preview", | |
"api_key": "PASTE_YOUR_API_KEY_HERE" | |
}, | |
{ |
This file contains 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
[ | |
{ | |
"model": "gpt-4", | |
"api_key": "PASTE_YOUR_API_KEY_HERE" | |
}, | |
{ | |
"model": "gpt-4-1106-preview", | |
"api_key": "PASTE_YOUR_API_KEY_HERE" | |
}, | |
{ |
This file contains 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 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 |
This file contains 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
# %% | |
# 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")) |
This file contains 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
# 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 |
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 theOPENAI_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"
This file contains 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
""" | |
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 |
This file contains 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
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 |
NewerOlder