Skip to content

Instantly share code, notes, and snippets.

View vikramsoni2's full-sized avatar

Vikram vikramsoni2

  • Baxter International
  • Madrid
View GitHub Profile
@vikramsoni2
vikramsoni2 / xgb_bayes_opt_cv.py
Created November 3, 2017 11:25 — forked from thomasjungblut/xgb_bayes_opt_cv.py
XGBoost hyper parameter optimization using bayes_opt
from bayes_opt import BayesianOptimization
from sklearn.cross_validation import KFold
import xgboost as xgb
def xgbCv(train, features, numRounds, eta, gamma, maxDepth, minChildWeight, subsample, colSample):
# prepare xgb parameters
params = {
"objective": "reg:linear",
"booster" : "gbtree",
"eval_metric": "mae",
@vikramsoni2
vikramsoni2 / imagenet1000_clsid_to_human.txt
Created January 5, 2019 15:47 — forked from yrevar/imagenet1000_clsidx_to_labels.txt
text: imagenet 1000 class id to human readable labels (Fox, E., & Guestrin, C. (n.d.). Coursera Machine Learning Specialization.)
{0: 'tench, Tinca tinca',
1: 'goldfish, Carassius auratus',
2: 'great white shark, white shark, man-eater, man-eating shark, Carcharodon carcharias',
3: 'tiger shark, Galeocerdo cuvieri',
4: 'hammerhead, hammerhead shark',
5: 'electric ray, crampfish, numbfish, torpedo',
6: 'stingray',
7: 'cock',
8: 'hen',
9: 'ostrich, Struthio camelus',
apt-get update && apt-get -y upgrade
apt-get install -y wireguard-tools dumb-init git
#Install NodeJS
curl -sL https://deb.nodesource.com/setup_16.x | bash -
apt-get update && apt-get -y upgrade
apt -y install nodejs
#Install WG Easy
git clone https://github.com/WeeJeWel/wg-easy WGEASY
@vikramsoni2
vikramsoni2 / wg-easy.service
Created September 17, 2023 21:41 — forked from WeslieDE/wg-easy.service
systemd servicefile for wg-easy
[Unit]
Description=WG-Easy Service
After=network.target
[Service]
ExecStart=/usr/bin/node /app/server.js
WorkingDirectory=/app
Restart=always
User=root
Group=nogroup
@vikramsoni2
vikramsoni2 / main.py
Created October 27, 2023 19:10 — forked from jvelezmagic/main.py
QA Chatbot streaming with source documents example using FastAPI, LangChain Expression Language, OpenAI, and Chroma.
"""QA Chatbot streaming using FastAPI, LangChain Expression Language , OpenAI, and Chroma.
Features
--------
- Persistent Chat Memory:
Stores chat history in a local file.
- Persistent Vector Store:
Stores document embeddings in a local vector store.
- Standalone Question Generation:
Rephrases follow-up questions to standalone questions in their original language.
#pip install git+https://github.com/huggingface/transformers.git
import datetime
import sys
from transformers import pipeline
from transformers.pipelines.audio_utils import ffmpeg_microphone_live
pipe = pipeline("automatic-speech-recognition", model="openai/whisper-base", device=0)
sampling_rate = pipe.feature_extractor.sampling_rate