Created
June 6, 2023 06:08
-
-
Save LI-GUOJIE/69d4fe7e870a6607ace2d59f707e2766 to your computer and use it in GitHub Desktop.
recurrentgpt.ipynb
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
{ | |
"cells": [ | |
{ | |
"cell_type": "markdown", | |
"metadata": { | |
"id": "view-in-github", | |
"colab_type": "text" | |
}, | |
"source": [ | |
"<a href=\"https://colab.research.google.com/gist/LI-GUOJIE/69d4fe7e870a6607ace2d59f707e2766/recurrentgpt.ipynb\" target=\"_parent\"><img src=\"https://colab.research.google.com/assets/colab-badge.svg\" alt=\"Open In Colab\"/></a>" | |
] | |
}, | |
{ | |
"cell_type": "markdown", | |
"metadata": { | |
"id": "z3-6CtjZwvYb" | |
}, | |
"source": [ | |
"# Use your own key" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": null, | |
"metadata": { | |
"id": "qMaNg5vYnrnf" | |
}, | |
"outputs": [], | |
"source": [ | |
"API_KEY=\"sk-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\"" | |
] | |
}, | |
{ | |
"cell_type": "markdown", | |
"metadata": { | |
"id": "_ccgFztywkCD" | |
}, | |
"source": [ | |
"# Install requirements" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": null, | |
"metadata": { | |
"id": "0Jw1XgyziWrr" | |
}, | |
"outputs": [], | |
"source": [ | |
"!git clone https://github.com/aiwaves-cn/RecurrentGPT.git" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": null, | |
"metadata": { | |
"id": "X5TKoFP7neev" | |
}, | |
"outputs": [], | |
"source": [ | |
"!pip install openai" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": null, | |
"metadata": { | |
"id": "9PbIRG84omsC" | |
}, | |
"outputs": [], | |
"source": [ | |
"!pip install sentence_transformers" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": null, | |
"metadata": { | |
"id": "Cr_bmiO20_fw" | |
}, | |
"outputs": [], | |
"source": [ | |
"!pip install gradio" | |
] | |
}, | |
{ | |
"cell_type": "markdown", | |
"metadata": { | |
"id": "TlCES9XHxVqB" | |
}, | |
"source": [ | |
"# Run recurrent" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": null, | |
"metadata": { | |
"id": "BJlvxTAeneb5" | |
}, | |
"outputs": [], | |
"source": [ | |
"!sed -i -e \"s/your_api_key/{API_KEY}/\" RecurrentGPT/recurrent.sh\n", | |
"# You can change some other arguments here by sed command.\n", | |
"!cat RecurrentGPT/recurrent.sh" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": null, | |
"metadata": { | |
"id": "0Y7yZEMBomut" | |
}, | |
"outputs": [], | |
"source": [ | |
"!cd RecurrentGPT; sh recurrent.sh" | |
] | |
}, | |
{ | |
"cell_type": "markdown", | |
"metadata": { | |
"id": "S3Av_qhQ3-eS" | |
}, | |
"source": [ | |
"# Run your own web server" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": null, | |
"metadata": { | |
"id": "CFp7jzU0y4Ap" | |
}, | |
"outputs": [], | |
"source": [ | |
"%env OPENAI_API_KEY={API_KEY}\n", | |
"!cd RecurrentGPT; python gradio_server.py" | |
] | |
} | |
], | |
"metadata": { | |
"colab": { | |
"toc_visible": true, | |
"provenance": [], | |
"authorship_tag": "ABX9TyOSUw/oftAkxPNoZnGuU5DS", | |
"include_colab_link": true | |
}, | |
"kernelspec": { | |
"display_name": "Python 3", | |
"name": "python3" | |
}, | |
"language_info": { | |
"name": "python" | |
} | |
}, | |
"nbformat": 4, | |
"nbformat_minor": 0 | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment