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
// Updated: Aug. 15, 2024 | |
// Run: node testRegex.js testText.txt | |
// Used in https://jina.ai/tokenizer | |
const fs = require('fs'); | |
const util = require('util'); | |
// Define variables for magic numbers | |
const MAX_HEADING_LENGTH = 7; | |
const MAX_HEADING_CONTENT_LENGTH = 200; | |
const MAX_HEADING_UNDERLINE_LENGTH = 200; |
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 contextlib import redirect_stdout | |
import pandas as pd | |
from langchain.chains import LLMChain | |
from langchain.chat_models import ChatOpenAI | |
from io import StringIO | |
from langchain import PromptTemplate | |
prompt_template = """ | |
This is the head of the dataframe df {df_head}. | |
This is the list of df column names {df_columns}. |
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
## Install necessary libraries | |
sudo apt update && | |
sudo apt install build-essential libglvnd-dev pkg-config | |
## Download the drivers | |
wget https://us.download.nvidia.com/XFree86/Linux-x86_64/470.57.02/NVIDIA-Linux-x86_64-470.57.02.run | |
## Remove the existing Nvidia drivers, utils, libs etc. | |
sudo apt purge nvidia* | |
sudo apt purge nvidia-driver* |
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 string | |
import re | |
import nltk | |
def preprocess_text(text): | |
# Make lowercase | |
text = text.lower() | |
#print(text) |
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
"""main.py | |
An example script for demoing swaggerui functionality with quart | |
""" | |
import os | |
from quart import Quart, request, flash, make_response | |
from quart_swagger_blueprint import swagger_ui | |
app = Quart(__name__) |
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 json | |
from quart import Blueprint, send_from_directory | |
swagger_ui = Blueprint("swagger_ui", | |
__name__, | |
static_folder='swaggerui') | |
@swagger_ui.route('/swaggerui/') | |
@swagger_ui.route('/swaggerui/<path:path>') |
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
#!/bin/bash | |
## This gist contains step by step instructions to install cuda v9.0 and cudnn 7.2 in ubuntu 18.04 | |
### steps #### | |
# verify the system has a cuda-capable gpu | |
# download and install the nvidia cuda toolkit and cudnn | |
# setup environmental variables | |
# verify the installation | |
### |