(see YouTube channel for individual videos)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from transformers import PreTrainedTokenizerFast | |
fast_tokenizer = PreTrainedTokenizerFast(tokenizer_file="/home/ubuntu/LLM/module/claude-v1-tokenization.json") | |
text = "Hello, this is a test input." | |
tokens = fast_tokenizer.tokenize(text) | |
tokens |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// zod schema | |
z.object({ | |
// valid if string or: | |
optional: z.string().optional(), // field not provided, or explicitly `undefined` | |
nullable: z.string().nullable(), // field explicitly `null` | |
nullish: z.string().nullish(), // field not provided, explicitly `null`, or explicitly `undefined` | |
}); | |
// type | |
{ |
This solves: https://forums.expo.io/t/rn-expo-build-for-android-tv/9403 and https://stackoverflow.com/questions/51707841/android-tv-app-shows-white-screen
"android": {
...
"intentFilters": [
{
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import axios from 'axios'; | |
import qs from 'qs'; | |
// Customized Axios object for API calls | |
var Api = axios.create({ | |
// NOTE: Replace the API URL | |
baseURL: 'http://api.example.com/', | |
responseType: 'json', | |
withCredentials: true | |
// Add whatever you want to configure Axios here |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const waitFor = (ms) => new Promise(r => setTimeout(r, ms)) | |
const asyncForEach = async (array, callback) => { | |
for (let index = 0; index < array.length; index++) { | |
await callback(array[index], index, array) | |
} | |
} | |
const start = async () => { | |
await asyncForEach([1, 2, 3], async (num) => { | |
await waitFor(50) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* @file get/set caret position and insert text | |
* @author islishude | |
* @license MIT | |
*/ | |
export class Caret { | |
/** | |
* get/set caret position | |
* @param {HTMLColletion} target | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 1. Even or odd | |
function isEven(value){ | |
if (value % 2 == 0){ | |
return true; | |
} | |
else | |
return false; | |
} |
NewerOlder