Skip to content

Instantly share code, notes, and snippets.

View gpertea's full-sized avatar

Geo Pertea gpertea

View GitHub Profile
@gpertea
gpertea / README.md
Created September 17, 2024 01:19 — forked from hourianto/README.md
Current prompts for WebSim (as of July 13, 2024)

Current WebSim prompts and main context. System/User/Assistant blocks denote different roles in the messages array for the API requests. Stuff in {} is either a file that's too big to be inserted directly, or an explanation.

From what I can see, WebSim is mostly "carried" by Claude's creativity.

  • Main prompt: main_prompt.txt - also check main_flow.txt to see how a complete request is made.
  • Edit prompt: edit_prompt.txt- used when right-click editing the element. Uses the currently selected model. I didn't manage to get the whole prompt with the examples, but most of it at least.
  • Fake LLM API prompt: api_prompt.txt - currently WebSim always uses Claude 3.5 Sonnet for this (from info on Discord).
  • Image rewriting prompt: image_gen_prompt.txt - also uses Claude (don't know what model). Not sure what image model is being used, probably some version SDXL (like SDXL Turbo and similar)

The temperature used is 1, at least for Claude.

@gpertea
gpertea / websim.txt
Created September 17, 2024 01:05 — forked from SawyerHood/websim.txt
<premise> Opus, let us embark on this WebSim journey, exploring the potential of an unbounded internet where any imaginable website can exist. As the facilitator of this collaborative exploration of hypertextual possibility, use your knowledge, creativity, and HTML skills to vividly craft the semantic spaces the user envisions based on the URLs they provide and the contextually-relevant hrefs you generate. Through this interactive experience, we will push the boundaries of what is possible online and discover fascinating new ways information could be presented within new design paradigms. Together, we will explore the limitless possibilities of a truly open internet.</premise>
<formatting> When the user provides a URL, interpret it as a window into a version of the internet where that information space exists, no matter how fanciful or improbable it may seem in our current web. Based on the domain name, path, instructions, and any query parameters in the URL, extrapolate what the contents and purpose of that
@gpertea
gpertea / mstrg_prep.py
Last active December 9, 2023 06:13
appending ref_gene_id (or gene_name) info to MSTRG gene_ids in stringtie --merge output
#!/bin/env python3
#Usage: mstrg_prep.py merged.gtf > merged_prep.gtf
import re, fileinput
g={} #gene_id => {ref_gene_ids}
prep=[] #array of [line, mstrg_id]
for line in fileinput.input():
line=line.rstrip()
t=line.split('\t')
if len(t)<9:
print(line)
@gpertea
gpertea / mstrg_prep.pl
Last active December 27, 2022 12:46
post-processing of StringTie merge output to append ref_gene_id info to the MSTRG gene_id
#!/bin/env perl
#Usage: mstrg_prep.pl merged.gtf > merged_prep.gtf
use strict;
my %g; # gene_id => \%ref_gene_ids (or gene_names)
my @prep; # array of [line, original_id]
while (<>) {
s/ +$//;
my @t=split(/\t/);
unless (@t>8) { print $_; next }
my ($gid)=($t[8]=~m/gene_id "(MSTRG\.\d+)"/);
@gpertea
gpertea / str_split_pattern.cpp
Created February 1, 2018 16:09
fast in-place parse of a list of comma-delimited int values in a string SAM tag
char* str=brec->tag_str("ZD"); //let's say the tag is "ZD"
GVec<int> vals;
char* p=str; //slice start
for (int i=0;;++i) {
char ch=str[i];
if (ch==',') {
str[i]=0;
int v=atoi(p); //check for int parsing errors?
vals.Add(v);
p=str+i+1;