Skip to content

Instantly share code, notes, and snippets.

View phunterlau's full-sized avatar

Hongliang Liu phunterlau

  • Iceland
View GitHub Profile
@phunterlau
phunterlau / agent.py
Created September 15, 2024 22:40
financial agent demo without llama-index nor langchain
import os
import json
from typing import List, Dict, Any
from pydantic import BaseModel, Field
from openai import OpenAI
import requests
# Use system environment variable for OpenAI API key
client = OpenAI(api_key=os.environ.get("OPENAI_API_KEY"))
@phunterlau
phunterlau / webui-conda.sh
Created August 19, 2024 21:16
Conda version setup to run StableDiffusion webui
#!/usr/bin/env bash
#################################################
# Please do not make any changes to this file, #
# change the variables in webui-user.sh instead #
#################################################
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
# If run from macOS, load defaults from webui-macos-env.sh
if [[ "$OSTYPE" == "darwin"* ]]; then
@phunterlau
phunterlau / cool_gpu2.sh
Created September 19, 2016 22:17 — forked from squadbox/cool_gpu2.sh
A script to control Nvidia GPU fan speed on headless (non-X) linux nodes
#!/bin/bash
# cool_gpu2.sh This script will enable or disable fixed gpu fan speed
#
# Description: A script to control GPU fan speed on headless (non-X) linux nodes
# Original Script by Axel Kohlmeyer <akohlmey@gmail.com>
# https://sites.google.com/site/akohlmey/random-hacks/nvidia-gpu-coolness
#
# Modified for newer drivers and removed old work-arounds