This file contains hidden or 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 re | |
| text = """https://www.notion.so/enkrateialog/44a8f633dda74aa0b26b89ad960015fa?v=9be485bc35f44c68a9399f880844a45d | (7) Reference Sources | |
| https://chat.openai.com/?model=gpt-4-plugins | ChatGPT | |
| ... (remaining text) ...""" | |
| urls = re.findall(r'(https?://\S+)', text) | |
| print(urls) |
This file contains hidden or 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 subprocess | |
| import time | |
| def record_audio(): | |
| audio_file_path = "audio_output.wav" | |
| command = 'arecord -f cd -r 16000 ' + audio_file_path | |
| subprocess.run(command, shell=True) |
This file contains hidden or 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 | |
| openai.api_key = os.environ["OPENAI_API_KEY"] | |
| def get_chatgpt_response(prompt_question): | |
| response = openai.ChatCompletion.create( | |
| model="gpt-3.5-turbo", | |
| messages=[ | |
| {"role": "system", "content": "You are a helpful coding and learning assistant."}, |
This file contains hidden or 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 streamlit as st | |
| import os | |
| st.title("ChatGPT Like APP") | |
| openai.api_key = os.environ["OPENAI_API_KEY"] | |
| #if "openai_model" not in st.session_state: | |
| st.session_state["openai_model"] = st.sidebar.selectbox("Select your openai model!",["gpt-3.5-turbo", "gpt-4"]) |
This file contains hidden or 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
| # 1. Fetch a random paper from arxiv in the fields of: machine learning, AI, nlp, computer vision etc. | |
| import arxiv | |
| import random | |
| import time | |
| import requests | |
| def fetch_paper(title): | |
| """ |
This file contains hidden or 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 argparse | |
| from langchain.document_loaders import YoutubeLoader | |
| from langchain.indexes import VectorstoreIndexCreator | |
| def main(): | |
| parser = argparse.ArgumentParser(description='Query YouTube videos using ChatGPT with langchain package.') | |
| parser.add_argument('url', help='YouTube video URL') | |
| parser.add_argument('query', help='The query you want to ask about the video') | |
| parser.add_argument('-a', '--add_video_info', action='store_true', help='Add video information (default: False)') |
This file contains hidden or 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
| DELETE ME - Must create a new gist with an initial file |
This file contains hidden or 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
| <!DOCTYPE html> | |
| <html lang="en"> | |
| <head> | |
| <meta charset="UTF-8"> | |
| <meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
| <title>Learning Feed</title> | |
| <style> | |
| body { | |
| font-family: Arial, sans-serif; | |
| max-width: 800px; |
This file contains hidden or 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, render_template, request | |
| import openai | |
| import os | |
| # Set up the API key | |
| openai.api_key = "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" | |
| app = Flask(__name__) | |
| @app.route('/', methods=['GET', 'POST']) |
This file contains hidden or 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, render_template, request | |
| import openai | |
| import os | |
| # Set up the API key | |
| openai.api_key = "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" | |
| app = Flask(__name__) | |
| @app.route('/', methods=['GET', 'POST']) |