Skip to content

Instantly share code, notes, and snippets.

View julien-c's full-sized avatar
Real artists ship

Julien Chaumond julien-c

Real artists ship
View GitHub Profile
import logging
from transformers.modeling_bart import BartForSequenceClassification
from transformers.pipelines import TextClassificationPipeline
from transformers.tokenization_bart import BartTokenizer
logging.basicConfig(level=logging.INFO)
@julien-c
julien-c / ec2instances.md
Created April 3, 2020 20:12
simple markdown table of AWS instance types with vCPU/RAM/price (us-east-1)
API Name Memory vCPUs Physical Processor Network Performance Linux On Demand cost Linux Reserved cost
a1.2xlarge 16.0 GiB 8 vCPUs AWS Graviton Processor Up to 10 Gigabit $148.92 monthly $93.80 monthly
a1.4xlarge 32.0 GiB 16 vCPUs AWS Graviton Processor Up to 10 Gigabit $297.84 monthly $187.61 monthly
a1.large 4.0 GiB 2 vCPUs AWS Graviton Processor Up to 10 Gigabit $37.23 monthly $23.43 monthly
a1.medium 2.0 GiB 1 vCPUs AWS Graviton Processor Up to 10 Gigabit $18.61 monthly $11.75 monthly
a1.metal 32.0 GiB 16 vCPUs AWS Graviton Processor Up to 10 Gigabit $297.84 monthly $187.61 monthly
a1.xlarge 8.0 GiB 4 vCPUs AWS Graviton Processor Up to 10 Gigabit $74.46 monthly $46.93 monthly
c1.medium 1.7 GiB 2 vCPUs Intel Xeon Family Moderate $94.90 monthly $66.43 monthly
@julien-c
julien-c / ModelInfo.ts
Last active October 15, 2020 20:46
Model tag <=> pipeline type logic, for public reference
export class ModelInfo {
/**
* Key to config.json file.
*/
key: string;
etag: string;
lastModified: Date;
size: number;
modelId: ModelId;
author?: AuthorId;
import os
import subprocess
from huggingface_hub.hf_api import HfApi
from huggingface_hub.repository import Repository
os.makedirs("./Helsinki-NLP/", exist_ok=True)
os.environ["GIT_LFS_SKIP_SMUDGE"] = "1"
# Important, to not download the large files
Map(98) {
'unspecified' => 6519,
'unknown' => 230,
'cc-by-4.0' => 131,
'cc-by-sa-4.0' => 76,
'mit' => 73,
'apache-2.0' => 41,
'cc0-1.0' => 40,
'cc-by-nc-sa-4.0' => 36,
'cc-by-nc-4.0' => 21,