Skip to content

Instantly share code, notes, and snippets.

View John-Lin's full-sized avatar
👋
hi

Che-Wei Lin John-Lin

👋
hi
View GitHub Profile
@John-Lin
John-Lin / diff.py
Created September 5, 2023 10:58
Code Review Langchain PoC
from langchain.llms import OpenAI
from langchain.chains import LLMChain
from langchain.prompts import PromptTemplate
from langchain.chains import SimpleSequentialChain
code_diff = """
diff --git a/pkg/bot/execute.go b/pkg/bot/execute.go
index 5f8ec1e..796620b 100644
--- a/pkg/bot/execute.go
+++ b/pkg/bot/execute.go
@John-Lin
John-Lin / app.py
Last active August 1, 2023 13:36
LangChain with Llama2
from langchain.llms import LlamaCpp
from langchain import PromptTemplate, LLMChain
from langchain.callbacks.manager import CallbackManager
from langchain.callbacks.streaming_stdout import StreamingStdOutCallbackHandler
template_cot = """Question: {question}
Answer: Let's work this out in a step by step way to be sure we have the right answer."""
template_zero_shot = """{question}"""

Keybase proof

I hereby claim:

  • I am John-Lin on github.
  • I am johnlin_ (https://keybase.io/johnlin_) on keybase.
  • I have a public key whose fingerprint is 0412 942F AFE5 6937 4EF2 F245 F729 570C C1A6 E7BE

To claim this, I am signing this object:

@John-Lin
John-Lin / alacritty.yml
Last active December 25, 2019 11:11
dotfiles
# Configuration for Alacritty, the GPU enhanced terminal emulator.
# Any items in the `env` entry below will be added as
# environment variables. Some entries may override variables
# set by alacritty itself.
#env:
# TERM variable
#
# This value is used to set the `$TERM` environment variable for
# each instance of Alacritty. If it is not present, alacritty will
@John-Lin
John-Lin / Kubeflow.md
Last active November 10, 2022 19:31
Kubeflow on Minikube

Deploy Kubeflow on Minikube

Install minikube

Please see How to Minikube

Running a minikube with 4CPUs and 8GB memory

$ minikube start --cpus 4 --memory 8192
@John-Lin
John-Lin / Minikube.md
Created December 9, 2017 11:26
How to Minikube

Minikube

Installation

$ curl -Lo minikube https://storage.googleapis.com/minikube/releases/v0.24.0/minikube-darwin-amd64 && chmod +x minikube && sudo mv minikube /usr/local/bin/

Quickstart

@John-Lin
John-Lin / nswitch.py
Created September 8, 2017 15:48
SDN application for NORMAL action
from ryu.base import app_manager
from ryu.controller import ofp_event
from ryu.controller.handler import CONFIG_DISPATCHER
from ryu.controller.handler import set_ev_cls
from ryu.ofproto import ofproto_v1_3
class Switch(app_manager.RyuApp):
OFP_VERSIONS = [ofproto_v1_3.OFP_VERSION]
@John-Lin
John-Lin / benchmark.md
Last active October 25, 2017 11:54
Performance loss with VXLAN in OVS

Network performance testing tool

iperf

HOST to HOST

iperf -c 10.240.0.2 -p 12345 -i 1 -t 10 -w 20K

iperf -s -p 12345 -i 1 -M
@John-Lin
John-Lin / ovs
Created May 14, 2017 04:10
An overview of Open vSwitch implementation
+---------+ +-----------+
|ovs-ofctl| |sFlow Trend|
+----^----+ +-----^-----+
| | Remote
+-----------------------------------------------------------------------------------------------+
| |
| sFlow |
| | +---------+ +----------+ +---------+ +------------+
| | |ovs-dpctl| |ovs-appctl| |ovs-vsctl| |ovsdb-client|
| | +----+----+ +------^---+ +-----+---+ +-------^----+
@John-Lin
John-Lin / Vagrantfile
Created May 2, 2017 15:51
OVS with Docker Networking (GUI)
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure("2") do |config|
config.vm.box = "ubuntu/xenial64"
config.vm.provider "virtualbox" do |vb|
vb.gui = true
vb.customize ['modifyvm', :id, '--nictype1', 'Am79C973']
vb.customize ['modifyvm', :id, '--nicpromisc1', 'allow-all']
end
config.vm.provision :shell, path: "bootstrap.sh"