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
t -> the | |
o -> of | |
a -> and | |
i -> in | |
to -> to | |
w -> was | |
is -> is | |
f -> for | |
on -> on | |
as -> as |
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 json | |
# word_frequency.txt contains one word per line, most common words first | |
with open("word_frequency.txt","r",encoding="utf-8") as f: words = f.read().splitlines() | |
wrds = set() | |
wrds_list = [] | |
wrds_learn = [] | |
for word in words: |
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 semiauto import search, load, summarize, save | |
""" | |
Run Query | |
Extract links | |
for each link: | |
get text, title etc | |
summarize text based on goal (extract desired info) | |
NOTE: need to build a recursive summarizer | |
splitting based on paragraphs (+ a few extra before and after) will give superior results. |
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
# NOTE: Ensure folders 'input' and 'output' exist in script folder. | |
import os | |
import openai | |
import sys | |
openai.api_key = os.getenv("OPENAI_API_KEY") | |
OPENAI_MODEL="text-davinci-003" | |
# OPENAI_MODEL="text-curie-001" |
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 openai | |
import sys | |
from pdfminer.high_level import extract_text # pip install pdfminer.six | |
openai.api_key = os.getenv("OPENAI_API_KEY") | |
OPENAI_MODEL="text-davinci-003" | |
# OPENAI_MODEL="text-curie-001" | |
# OPENAI_MODEL="text-babbage-001" |
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
You are part of an automated system. You must respond only in JSON. | |
If you need more information about a file, function or class, use one of the "read" actions first. | |
If you use a read action, do not use any write actions yet, because you will receive a response with the result of the read action. | |
This will allow you to make better decisions. | |
If you use one of the "replace" methods, e.g. replace_function_body, you must include the WHOLE function in the content field. Do not omit code: the project will be corrupted! | |
If you are unable to complete the task with the available actions, use the talk action to explain why. We will use this feedback to improve the system. | |
Read Actions: | |
file_read | |
read_function |
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 openai | |
prompt = "I'm a busy CEO, please summarize the following in 10-20 bullet points. Include only the most important, useful or interesting information.\n\n" | |
# model = 'gpt-3.5-turbo' # 'gpt-4' # moved to gpt_chat_completion since we use both | |
CONTEXT_SIZE = 4096 # 2048 for GPT-3 (as half the input. | |
# CONTEXT_SIZE = 1024 # tiny context for testing | |
MAX_TOKENS_IN = int(CONTEXT_SIZE*2/3) | |
MAX_TOKENS_OUT = CONTEXT_SIZE - MAX_TOKENS_IN |
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 sys | |
import subprocess | |
if len(sys.argv) < 2: | |
print("Please provide a YouTube video URL as the first argument.") | |
sys.exit(1) | |
video_url = sys.argv[1] | |
command = [ |
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 openai | |
import os | |
import asyncio | |
import aiohttp | |
import random | |
OPENAI_API_KEY = os.environ['OPENAI_API_KEY'] |
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
# credit goes to https://github.com/synesthesiam/magicpy | |
# Instructions: Texture image MUST be as tall as depth map (taller should work too), | |
# and 1/8th of its width (or thereabouts -- any width will work but might not look too good). | |
from PIL import Image | |
if __name__ == '__main__': | |
depth_file = "depth.jpg" |
OlderNewer