Skip to content

Instantly share code, notes, and snippets.

View EzhilAdhavan's full-sized avatar
🎯
Focusing

Ezhil Adhavan EzhilAdhavan

🎯
Focusing
View GitHub Profile
@EzhilAdhavan
EzhilAdhavan / main.py
Created July 8, 2024 09:25
Load the model and tokenizer from the local path
from fastapi import FastAPI
from pydantic import BaseModel
from transformers import AutoModelForSequenceClassification, AutoTokenizer
from transformers import pipeline
import os
app = FastAPI()
local_model_path = "./models/bertweet_sentiment/"
@EzhilAdhavan
EzhilAdhavan / Codable.swift
Created October 16, 2023 09:16
Encode and Decode of [String: Any]
struct JSONCodingKeys: CodingKey {
var stringValue: String
var intValue: Int?
init?(stringValue: String) {
self.stringValue = stringValue
}
init?(intValue: Int) {
self.init(stringValue: "\(intValue)")
const http2 = require('http2');
const fs = require('fs');
/*
Use 'https://api.push.apple.com' for production build
*/
host = 'https://api.sandbox.push.apple.com'
path = '/3/device/{you device token}'
const jwt = require('jsonwebtoken');
const http2 = require('http2');
const fs = require('fs');
/*
Read p8 file. Assumes p8 file to be in same directory
*/
const key = fs.readFileSync(__dirname + "/{your p8 filename}.p8", 'utf8')
//"iat" should not be older than 1 hr from current time or will get rejected

Keybase proof

I hereby claim:

  • I am ezhiladhavan on github.
  • I am ezhiladhavan (https://keybase.io/ezhiladhavan) on keybase.
  • I have a public key ASAe5QDj5LJC4u7RsR5AuvF9D-m60RU-FKKv_nPI1IaluAo

To claim this, I am signing this object: