Skip to content

Instantly share code, notes, and snippets.

View sutyum's full-sized avatar

Satyam Tiwary sutyum

  • @TechnocultureResearch
  • Boodgaya, India
View GitHub Profile
@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:

@sutyum
sutyum / platformio.ini
Created January 26, 2022 17:24 — forked from carlosedp/platformio.ini
PlatformIO Renode Integration
; PlatformIO Project Configuration File
;
; Build options: build flags, source filter
; Upload options: custom upload port, speed and extra flags
; Library options: dependencies, extra library storages
; Advanced options: extra scripting
;
; Please visit documentation for the other options and examples
; https://docs.platformio.org/page/projectconf.html
@sutyum
sutyum / pio.yml
Created January 15, 2022 17:34
Platformio Github Action (Ignores semantic commits of type 'docs')
name: PlatformIO CI
on: [push]
jobs:
build:
runs-on: ubuntu-latest
if: "!startsWith(github.event.head_commit.message, 'docs')"
steps:
@sutyum
sutyum / RTclock.c
Created December 15, 2021 07:47
Real Time clock and nanosleep in linux
/****************************************************************************/
/* Function: nanosleep and POSIX 1003.1b RT clock demonstration */
/* */
/* Sam Siewert - 02/05/2011 */
/* */
/****************************************************************************/
#include <errno.h>
#include <pthread.h>
#include <stdio.h>
@sutyum
sutyum / SHED_FIFO.c
Created December 13, 2021 07:56
Use FIFO scheduling policy and Core affinity in linux
#define _GNU_SOURCE
#include <pthread.h>
#include <stdlib.h>
#include <stdio.h>
#include <sched.h>
#include <sys/sysinfo.h>
#include <sys/types.h>
#include <unistd.h>
#include <syslog.h>