Skip to content

Instantly share code, notes, and snippets.

View shellward's full-sized avatar

shellworld shellward

  • richmond, ky
View GitHub Profile
if not os.path.exists('/content'):
os.mkdir('/content')
from google.colab import drive
drive.mount('content/gdrive')
!pip install transformers accelerate torch
!pip install git+https://github.com/huggingface/diffusers.git
#############################################################
import os
@shellward
shellward / _KRS-web-scraper-GPT-IndexBuilder-Gradio-App.py
Last active January 22, 2023 23:12
Everything you'd need to create a gradio app for asking questions about Kentucky Laws
# All the code you need for a gradio app that can answers questions about kentucky law.
central_url = 'https://apps.legislature.ky.gov/law/statutes/'
import gradio as gr
import os
import json
from gpt_index import Document, SimpleDirectoryReader, GPTSimpleVectorIndex, MockLLMPredictor
import requests
from bs4 import BeautifulSoup
import pandas as pd
@shellward
shellward / recentTweets2News2Speech.py
Created December 30, 2022 04:44
playing around with chatgpt, tts, gradio, selenium
# You need to install the following packages
# !pip3 install --upgrade revChatGPT
# !pip3 install selenium
# !pip3 install gtts
# !pip3 install gradio
# !pip3 install ipython
# !pip3 install numpy
# Really ought to learn how to properly architect python applications
# instead of putting everything in one file like this
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
{
"cells": [
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/"
},
"id": "WSoOPmCCVvwd",
@shellward
shellward / gist:2d61d350aaa901d7b5513a88a26cea21
Created October 4, 2021 16:44
VQGAN + CLIP Text Token Randomizer
%%html
<style>
@import url("https://fonts.googleapis.com/css2?family=Arvo:wght@400;700&display=swap");
* {
font-family: "Arvo";
}
h3 {
margin-left:10%;
width: 80%;