Skip to content

Instantly share code, notes, and snippets.

View sutyum's full-sized avatar

Satyam Tiwary sutyum

  • @TechnocultureResearch
  • Boodgaya, India
View GitHub Profile
#ifndef U_TEST_H
#define U_TEST_H
#include <stdio.h>
#include <stdbool.h>
#include <string.h>
// Colored output macros
#define ANSI_COLOR_RED "\x1b[31m"
#define ANSI_COLOR_GREEN "\x1b[32m"
@sutyum
sutyum / style_guide.c
Last active August 12, 2024 10:38
Personal style guide for C
#include <stdio.h>
#include <stdlib.h> // for malloc
#include <memory.h>
#include <stdbool.h>
#include <assert.h> // In order to use: assert()
// 1. Use typedefs
typedef struct cat { char* name; } cat;
// 2. Use sized types
@sutyum
sutyum / api.py
Created July 24, 2024 11:31 — forked from charlesfrye/api.py
LLaMA 3.1 405B Instruct FP8 - vLLM - OpenAI-compatible server
import modal
vllm_image = modal.Image.debian_slim(python_version="3.10").pip_install(
[
"vllm==0.5.3post1", # LLM serving
"huggingface_hub==0.24.1", # download models from the Hugging Face Hub
"hf-transfer==0.1.8", # download models faster
]
)
@sutyum
sutyum / git_setup.sh
Created July 7, 2024 10:06
git_setup.sh
#!/bin/bash
# Prompt for email and name
read -p "Enter your GitHub email: " email
read -p "Enter your full name: " name
# Generate SSH key
ssh-keygen -t ed25519 -C "$email" -f ~/.ssh/id_ed25519 -N ""
# Start SSH agent and add key
@sutyum
sutyum / agentic.py
Created April 21, 2024 16:36
Agents with Instructor and Pydantic
#agentic.py
# https://discord.com/channels/1192246288507474000/1192247523604185189/1229828123764330577
from pydantic import BaseModel, Field
from typing import List
class Agent(BaseModel):
variable: str = Field(description="snake cased variable based off the agents role")
role: str = Field(description="The role of the agent", examples=["Senior Project Manager","Lead Developer","Senior Architect"])
models:
- model: NousResearch/Llama-2-70b-hf
# no parameters necessary for base model
- model: wanglab/ClinicalCamel-70B
parameters:
weight: 0.08
density: 0.45
- model: epfl-llm/meditron-70b
parameters:
weight: 0.08
models:
- model: NousResearch/Nous-Hermes-Llama2-13b
# no parameters necessary for base model
- model: starmpcc/Asclepius-Llama2-13B
parameters:
weight: 0.08
density: 0.45
- model: axiong/PMC_LLaMA_13B
parameters:
weight: 0.08
@sutyum
sutyum / upload_merge.py
Last active January 21, 2024 13:26
Upload a merged model in Huggingface
import argparse
import yaml
from huggingface_hub import ModelCard, HfApi
from jinja2 import Template
# Argument parser setup
parser = argparse.ArgumentParser(description='Create a repo on Huggingface for the model and upload it.')
parser.add_argument('model_name', type=str, help='Model name')
parser.add_argument('--new', action='store_true', default=True, help='Create new repo')
parser.add_argument('-y', '--yaml_path', type=str, required=True, help='Path to YAML configuration file')
models:
- model: NousResearch/Llama-2-7b-hf
# no parameters necessary for base model
- model: AdaptLLM/medicine-chat
parameters:
weight: 0.08
density: 0.45
- model: starmpcc/Asclepius-Llama2-7B
parameters:
weight: 0.08
@sutyum
sutyum / README.md
Created May 30, 2022 20:21 — forked from tiagocoutinho/README.md
Virtual serial line (RS232) on linux with socat and pyserial

Virtual serial line

Virtual serial line on linux with socat, python server & client

Run on terminal 1:

socat -d -d pty,raw,echo=0,link=/tmp/cryocon_simulator pty,raw,echo=0,link=/tmp/cryocon

Run on terminal 2: