Skip to content

Instantly share code, notes, and snippets.

View philippn's full-sized avatar

Philipp Nanz philippn

  • Bamberg, Germany
View GitHub Profile
@philippn
philippn / CONVERSION.md
Last active April 21, 2024 12:02
Converting Llama3 for use in llama.cpp

Converting Llama3 for use in llama.cpp

Download model from Hugging Face

Insert your Hugging Face token in the following Python code and execute it. This step will essentially clone the models Git repo into a folder named llama3-8b-instruct-hf.

from huggingface_hub import snapshot_download
model_id="meta-llama/Meta-Llama-3-8B-Instruct"
access_token = "hf_XYZ"
snapshot_download(repo_id=model_id, local_dir="llama3-8b-instruct-hf",
                  local_dir_use_symlinks=False, revision="main", token=access_token)
@philippn
philippn / pom.xml
Created April 7, 2023 10:16
Example POM for Spring Boot issue #34892
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.7.10</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
@philippn
philippn / oauth2-proxy-values.yaml
Created October 13, 2022 10:09
Values for OAuth2 Proxy helm chart in combination with AGIC
config:
clientID: xxx
clientSecret: yyy
cookieSecret: zzz
configFile: |-
email_domains = [ "example.com" ]
upstreams = [ "http://upstream-my-service.namespace.svc.cluster.local:8080" ]
cookie_secure = "false"
cookie_domains= [ "" ]
whitelist_domains = [ "my-service.cluster.example.com" ]
/*
* highlight.js Structured Text syntax highlighting definition
*
* @see https://github.com/highlightjs/highlight.js
*
* @package: highlightjs-iecst
* @author: Sergey Romanov <serg4172@mail.ru>
* @since: 2019-08-02
*
* Description: Structured Text is one of the 6 languages of IEC 61131-3
@philippn
philippn / create-pipeline.xsl
Last active September 6, 2019 16:47
A XSL transformation that constructs a single bootstrap.xsl from a bunch of XSL files comprising a pipeline. Useful for getting a XSL pipeline to work in Saxon-JS. In order to do so, first run this XSL, then compile the resulting bootstrap.xsl into SEF format, i.e. by using Oxygen.
<xsl:stylesheet
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0">
<xsl:variable name="steps" select="collection('./xsl?select=*.xsl')" as="node()*"/>
<xsl:template match="/">
<xsl:for-each select="$steps">
<xsl:sort select="tokenize(base-uri(.), '/')[last()]"/>
<xsl:variable name="filename" select="tokenize(base-uri(.), '/')[last()]" as="xs:string"/>
@philippn
philippn / JarProtocolNormalizingUriResolver.java
Created June 8, 2017 07:10
A custom URIResolver that makes DeltaXML compatible with Spring Boot
import java.net.URI;
import javax.xml.transform.sax.SAXSource;
import net.sf.saxon.Configuration;
import net.sf.saxon.lib.StandardURIResolver;
public class JarProtocolNormalizingUriResolver extends StandardURIResolver {
private static final long serialVersionUID = -5732403477669089951L;