Skip to content

Instantly share code, notes, and snippets.

View ngaloppo's full-sized avatar

Nico Galoppo ngaloppo

View GitHub Profile
-D CMAKE_INSTALL_PREFIX=install -D CMAKE_BUILD_TYPE=Release -D ENABLE_PYTHON=ON -D ENABLE_WHEEL=ON -D ENABLE_CPPLINT=OFF -D ENABLE_CLANG_FORMAT=OFF -D ENABLE_PROFILING_ITT=OFF
@ngaloppo
ngaloppo / Dockerfile
Last active November 3, 2023 17:45
Build OpenVINO for SLES in Docker
FROM opensuse/leap:15.3 as ov-builder
ARG OPENVINO_RELEASE_BRANCH=releases/2023/2
WORKDIR /tmp
RUN zypper -n install git
RUN git clone --single-branch --branch ${OPENVINO_RELEASE_BRANCH} https://github.com/openvinotoolkit/openvino.git && \
cd openvino && \
git submodule update --init --recursive && \
chmod +x install_build_dependencies.sh && \
./install_build_dependencies.sh
"""## Loading the dataset"""
from datasets import load_dataset, load_metric, load_from_disk
from pathlib import Path
raw_datasets = load_dataset("samsum")
metric = load_metric("rouge")
model_checkpoint = "lidiya/bart-large-xsum-samsum"
@ngaloppo
ngaloppo / quantize.py
Last active August 1, 2023 22:24
A script to quantize BART with HF's OVQuantizer
from functools import partial
from transformers import AutoModelForSeq2SeqLM, AutoTokenizer
from optimum.intel import OVConfig, OVQuantizer
max_input_length = 512
max_target_length = 128
model_id = "lidiya/bart-large-xsum-samsum"
model = AutoModelForSeq2SeqLM.from_pretrained(model_id)
name: "MobileNet-SSD"
input: "data"
input_shape {
dim: 1
dim: 3
dim: 300
dim: 300
}
layer {
name: "conv0"
@ngaloppo
ngaloppo / ubuntu-netbios-howto.md
Created November 23, 2016 06:24
How to install NETBIOS hostname resolution on Ubuntu

Installing NETBIOS hostname resolution on Ubuntu

Install prerequisites:

sudo apt-get libnss-winbind winbind

Then, edit /etc/nsswitch.conf and add wins to the hosts line.

Heading

  1. I believe

  2. That

    1. we

    2. are

    3. new

  3. To the hello

name: "VGG_ILSVRC_16_layers"
input: "data"
input_shape {
dim: 1
dim: 3
dim: 224
dim: 224
}
@ngaloppo
ngaloppo / video_info.py
Created March 23, 2016 18:28
OpenCV video information extraction
from __future__ import (absolute_import, division, print_function,
unicode_literals)
import logging
import cv2 as cv
import argparse
import os
log = logging.getLogger('test_video')
@ngaloppo
ngaloppo / pythonvimfix.txt
Last active December 30, 2015 20:03
editorconfig / anaconda / vim fix
Make sure PYTHONHOME is set to the right path!