Skip to content

Instantly share code, notes, and snippets.

View hkaraoguz's full-sized avatar

Hakan Karaoguz hkaraoguz

View GitHub Profile
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}.
@hkaraoguz
hkaraoguz / Installation Guide
Last active May 13, 2023 15:12
How to install Nvidia 470.57.02 Drivers for Ubuntu 20.04 using a run file
## 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*
@hkaraoguz
hkaraoguz / text_preprocess.py
Last active October 28, 2020 20:53
sample text preprocessing for nlp
import string
import re
import nltk
def preprocess_text(text):
# Make lowercase
text = text.lower()
#print(text)
"""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__)
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>')
@hkaraoguz
hkaraoguz / cuda_installation_on_ubuntu_18.04
Last active May 2, 2019 09:55 — forked from Mahedi-61/cuda_11.8_installation_on_Ubuntu_22.04
cuda 9.0 complete installation procedure for ubuntu 18.04 LTS
#!/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
###