Brunobkr/llama.cpp_AlgMor24_github
ΩFFFΣLLIa • llama.cpp • AlgMor24 ██████╗ ███████╗███████╗███████╗██╗ ██╗ ██╗ █████╗ ██╔═══██╗██╔════╝██╔════╝██╔════╝██║ ██║ ██║██╔══██╗ ██║ ██║█████╗ █████╗ █████╗ ██║ ██║ ██║███████║ ██║ ██║██╔══╝ ██╔══╝ ██╔══╝ ██║ ██║ ██║██╔══██║ ╚██████╔╝██║ ██║ ███████╗███████╗███████╗██║██║ ██║ ╚═════╝ ╚═╝ ╚═╝ ╚══════╝╚══════╝╚══════╝╚═╝╚═╝ ╚═╝ High-Performance LLM / VLM Inference & Autonomous Agentic Ecosystem… See the full description on the dataset page: https://huggingface.co/datasets/Brunobkr/llama.cpp_AlgMor24_github.
03.1k
1import type { Angle, CssColor, Rule, CustomProperty, EnvironmentVariable, Function, Image, LengthValue, MediaQuery, Declaration, Ratio, Resolution, Selector, SupportsCondition, Time, Token, TokenOrValue, UnknownAtRule, Url, Variable, StyleRule, DeclarationBlock, ParsedComponent, Multiplier, StyleSheet, Location2 } from './ast';2import { Targets, Features } from './targets';3 4export * from './ast';5 6export { Targets, Features };7 8export interface TransformOptions<C extends CustomAtRules> {9 /** The filename being transformed. Used for error messages and source maps. */10 filename: string,11 /** The source code to transform. */12 code: Uint8Array,13 /** Whether to enable minification. */14 minify?: boolean,15 /** Whether to output a source map. */16 sourceMap?: boolean,17 /** An input source map to extend. */18 inputSourceMap?: string,19 /**20 * An optional project root path, used as the source root in the output source map.21 * Also used to generate relative paths for sources used in CSS module hashes.22 */23 projectRoot?: string,24 /** The browser targets for the generated code. */25 targets?: Targets,26 /** Features that should always be compiled, even when supported by targets. */27 include?: number,28 /** Features that should never be compiled, even when unsupported by targets. */29 exclude?: number,30 /** Whether to enable parsing various draft syntax. */31 drafts?: Drafts,32 /** Whether to enable various non-standard syntax. */33 nonStandard?: NonStandard,34 /** Whether to compile this file as a CSS module. */35 cssModules?: boolean | CSSModulesConfig,36 /**37 * Whether to analyze dependencies (e.g. `@import` and `url()`).38 * When enabled, `@import` rules are removed, and `url()` dependencies39 * are replaced with hashed placeholders that can be replaced with the final40 * urls later (after bundling). Dependencies are returned as part of the result.41 */42 analyzeDependencies?: boolean | DependencyOptions,43 /**44 * Replaces user action pseudo classes with class names that can be applied from JavaScript.45 * This is useful for polyfills, for example.46 */47 pseudoClasses?: PseudoClasses,48 /**49 * A list of class names, ids, and custom identifiers (e.g. @keyframes) that are known50 * to be unused. These will be removed during minification. Note that these are not51 * selectors but individual names (without any . or # prefixes).52 */53 unusedSymbols?: string[],54 /**55 * Whether to ignore invalid rules and declarations rather than erroring.56 * When enabled, warnings are returned, and the invalid rule or declaration is57 * omitted from the output code.58 */59 errorRecovery?: boolean,60 /**61 * An AST visitor object. This allows custom transforms or analysis to be implemented in JavaScript.62 * Multiple visitors can be composed into one using the `composeVisitors` function.63 * For optimal performance, visitors should be as specific as possible about what types of values64 * they care about so that JavaScript has to be called as little as possible.65 */66 visitor?: Visitor<C>,67 /**68 * Defines how to parse custom CSS at-rules. Each at-rule can have a prelude, defined using a CSS69 * [syntax string](https://drafts.css-houdini.org/css-properties-values-api/#syntax-strings), and70 * a block body. The body can be a declaration list, rule list, or style block as defined in the71 * [css spec](https://drafts.csswg.org/css-syntax/#declaration-rule-list).72 */73 customAtRules?: C74}75 76// This is a hack to make TS still provide autocomplete for `property` vs. just making it `string`.77type PropertyStart = '-' | '_' | 'a' | 'b' | 'c' | 'd' | 'e' | 'f' | 'g' | 'h' | 'i' | 'j' | 'k' | 'l' | 'm' | 'n' | 'o' | 'p' | 'q' | 'r' | 's' | 't' | 'u' | 'v' | 'w' | 'x' | 'y' | 'z';78export type ReturnedDeclaration = Declaration | {79 /** The property name. */80 property: `${PropertyStart}${string}`,81 /** The raw string value for the declaration. */82 raw: string83};84 85export type ReturnedMediaQuery = MediaQuery | {86 /** The raw string value for the media query. */87 raw: string88};89 90type FindByType<Union, Name> = Union extends { type: Name } ? Union : never;91export type ReturnedRule = Rule<ReturnedDeclaration, ReturnedMediaQuery>;92type RequiredValue<Rule> = Rule extends { value: object }93 ? Rule['value'] extends StyleRule94 ? Rule & { value: Required<StyleRule> & { declarations: Required<DeclarationBlock> } }95 : Rule & { value: Required<Rule['value']> }96 : Rule;97type RuleVisitor<R = RequiredValue<Rule>> = ((rule: R) => ReturnedRule | ReturnedRule[] | void);98type MappedRuleVisitors = {99 [Name in Exclude<Rule['type'], 'unknown' | 'custom'>]?: RuleVisitor<RequiredValue<FindByType<Rule, Name>>>;100}101 102type UnknownVisitors<T> = {103 [name: string]: RuleVisitor<T>104}105 106type CustomVisitors<T extends CustomAtRules> = {107 [Name in keyof T]?: RuleVisitor<CustomAtRule<Name, T[Name]>>108};109 110type AnyCustomAtRule<C extends CustomAtRules> = {111 [Key in keyof C]: CustomAtRule<Key, C[Key]>112}[keyof C];113 114type RuleVisitors<C extends CustomAtRules> = MappedRuleVisitors & {115 unknown?: UnknownVisitors<UnknownAtRule> | Omit<RuleVisitor<UnknownAtRule>, keyof CallableFunction>,116 custom?: CustomVisitors<C> | Omit<RuleVisitor<AnyCustomAtRule<C>>, keyof CallableFunction>117};118 119type PreludeTypes = Exclude<ParsedComponent['type'], 'literal' | 'repeated' | 'token'>;120type SyntaxString = `<${PreludeTypes}>` | `<${PreludeTypes}>+` | `<${PreludeTypes}>#` | (string & {});121type ComponentTypes = {122 [Key in PreludeTypes as `<${Key}>`]: FindByType<ParsedComponent, Key>123};124 125type Repetitions = {126 [Key in PreludeTypes as `<${Key}>+` | `<${Key}>#`]: {127 type: "repeated",128 value: {129 components: FindByType<ParsedComponent, Key>[],130 multiplier: Multiplier131 }132 }133};134 135type MappedPrelude = ComponentTypes & Repetitions;136type MappedBody<P extends CustomAtRuleDefinition['body']> = P extends 'style-block' ? 'rule-list' : P;137interface CustomAtRule<N, R extends CustomAtRuleDefinition> {138 name: N,139 prelude: R['prelude'] extends keyof MappedPrelude ? MappedPrelude[R['prelude']] : ParsedComponent,140 body: FindByType<CustomAtRuleBody, MappedBody<R['body']>>,141 loc: Location2142}143 144type CustomAtRuleBody = {145 type: 'declaration-list',146 value: Required<DeclarationBlock>147} | {148 type: 'rule-list',149 value: RequiredValue<Rule>[]150};151 152type FindProperty<Union, Name> = Union extends { property: Name } ? Union : never;153type DeclarationVisitor<P = Declaration> = ((property: P) => ReturnedDeclaration | ReturnedDeclaration[] | void);154type MappedDeclarationVisitors = {155 [Name in Exclude<Declaration['property'], 'unparsed' | 'custom'>]?: DeclarationVisitor<FindProperty<Declaration, Name> | FindProperty<Declaration, 'unparsed'>>;156}157 158type CustomPropertyVisitors = {159 [name: string]: DeclarationVisitor<CustomProperty>160}161 162type DeclarationVisitors = MappedDeclarationVisitors & {163 custom?: CustomPropertyVisitors | DeclarationVisitor<CustomProperty>164}165 166interface RawValue {167 /** A raw string value which will be parsed like CSS. */168 raw: string169}170 171type TokenReturnValue = TokenOrValue | TokenOrValue[] | RawValue | void;172type TokenVisitor = (token: Token) => TokenReturnValue;173type VisitableTokenTypes = 'ident' | 'at-keyword' | 'hash' | 'id-hash' | 'string' | 'number' | 'percentage' | 'dimension';174type TokenVisitors = {175 [Name in VisitableTokenTypes]?: (token: FindByType<Token, Name>) => TokenReturnValue;176}177 178type FunctionVisitor = (fn: Function) => TokenReturnValue;179type EnvironmentVariableVisitor = (env: EnvironmentVariable) => TokenReturnValue;180type EnvironmentVariableVisitors = {181 [name: string]: EnvironmentVariableVisitor182};183 184export interface Visitor<C extends CustomAtRules> {185 StyleSheet?(stylesheet: StyleSheet): StyleSheet<ReturnedDeclaration, ReturnedMediaQuery> | void;186 StyleSheetExit?(stylesheet: StyleSheet): StyleSheet<ReturnedDeclaration, ReturnedMediaQuery> | void;187 Rule?: RuleVisitor | RuleVisitors<C>;188 RuleExit?: RuleVisitor | RuleVisitors<C>;189 Declaration?: DeclarationVisitor | DeclarationVisitors;190 DeclarationExit?: DeclarationVisitor | DeclarationVisitors;191 Url?(url: Url): Url | void;192 Color?(color: CssColor): CssColor | void;193 Image?(image: Image): Image | void;194 ImageExit?(image: Image): Image | void;195 Length?(length: LengthValue): LengthValue | void;196 Angle?(angle: Angle): Angle | void;197 Ratio?(ratio: Ratio): Ratio | void;198 Resolution?(resolution: Resolution): Resolution | void;199 Time?(time: Time): Time | void;200 CustomIdent?(ident: string): string | void;201 DashedIdent?(ident: string): string | void;202 MediaQuery?(query: MediaQuery): ReturnedMediaQuery | ReturnedMediaQuery[] | void;203 MediaQueryExit?(query: MediaQuery): ReturnedMediaQuery | ReturnedMediaQuery[] | void;204 SupportsCondition?(condition: SupportsCondition): SupportsCondition;205 SupportsConditionExit?(condition: SupportsCondition): SupportsCondition;206 Selector?(selector: Selector): Selector | Selector[] | void;207 Token?: TokenVisitor | TokenVisitors;208 Function?: FunctionVisitor | { [name: string]: FunctionVisitor };209 FunctionExit?: FunctionVisitor | { [name: string]: FunctionVisitor };210 Variable?(variable: Variable): TokenReturnValue;211 VariableExit?(variable: Variable): TokenReturnValue;212 EnvironmentVariable?: EnvironmentVariableVisitor | EnvironmentVariableVisitors;213 EnvironmentVariableExit?: EnvironmentVariableVisitor | EnvironmentVariableVisitors;214}215 216export interface CustomAtRules {217 [name: string]: CustomAtRuleDefinition218}219 220export interface CustomAtRuleDefinition {221 /**222 * Defines the syntax for a custom at-rule prelude. The value should be a223 * CSS [syntax string](https://drafts.css-houdini.org/css-properties-values-api/#syntax-strings)224 * representing the types of values that are accepted. This property may be omitted or225 * set to null to indicate that no prelude is accepted.226 */227 prelude?: SyntaxString | null,228 /**229 * Defines the type of body contained within the at-rule block.230 * - declaration-list: A CSS declaration list, as in a style rule.231 * - rule-list: A list of CSS rules, as supported within a non-nested232 * at-rule such as `@media` or `@supports`.233 * - style-block: Both a declaration list and rule list, as accepted within234 * a nested at-rule within a style rule (e.g. `@media` inside a style rule235 * with directly nested declarations).236 */237 body?: 'declaration-list' | 'rule-list' | 'style-block' | null238}239 240export interface DependencyOptions {241 /** Whether to preserve `@import` rules rather than removing them. */242 preserveImports?: boolean243}244 245export type BundleOptions<C extends CustomAtRules> = Omit<TransformOptions<C>, 'code'>;246 247export interface BundleAsyncOptions<C extends CustomAtRules> extends BundleOptions<C> {248 resolver?: Resolver;249}250 251/** Custom resolver to use when loading CSS files. */252export interface Resolver {253 /** Read the given file and return its contents as a string. */254 read?: (file: string) => string | Promise<string>;255 256 /**257 * Resolve the given CSS import specifier from the provided originating file to a258 * path which gets passed to `read()`.259 */260 resolve?: (specifier: string, originatingFile: string) => string | Promise<string>;261}262 263export interface Drafts {264 /** Whether to enable @custom-media rules. */265 customMedia?: boolean266}267 268export interface NonStandard {269 /** Whether to enable the non-standard >>> and /deep/ selector combinators used by Angular and Vue. */270 deepSelectorCombinator?: boolean271}272 273export interface PseudoClasses {274 hover?: string,275 active?: string,276 focus?: string,277 focusVisible?: string,278 focusWithin?: string279}280 281export interface TransformResult {282 /** The transformed code. */283 code: Uint8Array,284 /** The generated source map, if enabled. */285 map: Uint8Array | void,286 /** CSS module exports, if enabled. */287 exports: CSSModuleExports | void,288 /** CSS module references, if `dashedIdents` is enabled. */289 references: CSSModuleReferences,290 /** `@import` and `url()` dependencies, if enabled. */291 dependencies: Dependency[] | void,292 /** Warnings that occurred during compilation. */293 warnings: Warning[]294}295 296export interface Warning {297 message: string,298 type: string,299 value?: any,300 loc: ErrorLocation301}302 303export interface CSSModulesConfig {304 /** The pattern to use when renaming class names and other identifiers. Default is `[hash]_[local]`. */305 pattern?: string,306 /** Whether to rename dashed identifiers, e.g. custom properties. */307 dashedIdents?: boolean,308 /** Whether to enable hashing for `@keyframes`. */309 animation?: boolean,310 /** Whether to enable hashing for CSS grid identifiers. */311 grid?: boolean,312 /** Whether to enable hashing for `@container` names. */313 container?: boolean,314 /** Whether to enable hashing for custom identifiers. */315 customIdents?: boolean,316 /** Whether to require at least one class or id selector in each rule. */317 pure?: boolean318}319 320export type CSSModuleExports = {321 /** Maps exported (i.e. original) names to local names. */322 [name: string]: CSSModuleExport323};324 325export interface CSSModuleExport {326 /** The local (compiled) name for this export. */327 name: string,328 /** Whether the export is referenced in this file. */329 isReferenced: boolean,330 /** Other names that are composed by this export. */331 composes: CSSModuleReference[]332}333 334export type CSSModuleReferences = {335 /** Maps placeholder names to references. */336 [name: string]: DependencyCSSModuleReference,337};338 339export type CSSModuleReference = LocalCSSModuleReference | GlobalCSSModuleReference | DependencyCSSModuleReference;340 341export interface LocalCSSModuleReference {342 type: 'local',343 /** The local (compiled) name for the reference. */344 name: string,345}346 347export interface GlobalCSSModuleReference {348 type: 'global',349 /** The referenced global name. */350 name: string,351}352 353export interface DependencyCSSModuleReference {354 type: 'dependency',355 /** The name to reference within the dependency. */356 name: string,357 /** The dependency specifier for the referenced file. */358 specifier: string359}360 361export type Dependency = ImportDependency | UrlDependency;362 363export interface ImportDependency {364 type: 'import',365 /** The url of the `@import` dependency. */366 url: string,367 /** The media query for the `@import` rule. */368 media: string | null,369 /** The `supports()` query for the `@import` rule. */370 supports: string | null,371 /** The source location where the `@import` rule was found. */372 loc: SourceLocation,373 /** The placeholder that the import was replaced with. */374 placeholder: string375}376 377export interface UrlDependency {378 type: 'url',379 /** The url of the dependency. */380 url: string,381 /** The source location where the `url()` was found. */382 loc: SourceLocation,383 /** The placeholder that the url was replaced with. */384 placeholder: string385}386 387export interface SourceLocation {388 /** The file path in which the dependency exists. */389 filePath: string,390 /** The start location of the dependency. */391 start: Location,392 /** The end location (inclusive) of the dependency. */393 end: Location394}395 396export interface Location {397 /** The line number (1-based). */398 line: number,399 /** The column number (0-based). */400 column: number401}402 403export interface ErrorLocation extends Location {404 filename: string405}406 407/**408 * Compiles a CSS file, including optionally minifying and lowering syntax to the given409 * targets. A source map may also be generated, but this is not enabled by default.410 */411export declare function transform<C extends CustomAtRules>(options: TransformOptions<C>): TransformResult;412 413export interface TransformAttributeOptions {414 /** The filename in which the style attribute appeared. Used for error messages and dependencies. */415 filename?: string,416 /** The source code to transform. */417 code: Uint8Array,418 /** Whether to enable minification. */419 minify?: boolean,420 /** The browser targets for the generated code. */421 targets?: Targets,422 /**423 * Whether to analyze `url()` dependencies.424 * When enabled, `url()` dependencies are replaced with hashed placeholders425 * that can be replaced with the final urls later (after bundling).426 * Dependencies are returned as part of the result.427 */428 analyzeDependencies?: boolean,429 /**430 * Whether to ignore invalid rules and declarations rather than erroring.431 * When enabled, warnings are returned, and the invalid rule or declaration is432 * omitted from the output code.433 */434 errorRecovery?: boolean,435 /**436 * An AST visitor object. This allows custom transforms or analysis to be implemented in JavaScript.437 * Multiple visitors can be composed into one using the `composeVisitors` function.438 * For optimal performance, visitors should be as specific as possible about what types of values439 * they care about so that JavaScript has to be called as little as possible.440 */441 visitor?: Visitor<never>442}443 444export interface TransformAttributeResult {445 /** The transformed code. */446 code: Uint8Array,447 /** `@import` and `url()` dependencies, if enabled. */448 dependencies: Dependency[] | void,449 /** Warnings that occurred during compilation. */450 warnings: Warning[]451}452 453/**454 * Compiles a single CSS declaration list, such as an inline style attribute in HTML.455 */456export declare function transformStyleAttribute(options: TransformAttributeOptions): TransformAttributeResult;457 458/**459 * Converts a browserslist result into targets that can be passed to lightningcss.460 * @param browserslist the result of calling `browserslist`461 */462export declare function browserslistToTargets(browserslist: string[]): Targets;463 464/**465 * Bundles a CSS file and its dependencies, inlining @import rules.466 */467export declare function bundle<C extends CustomAtRules>(options: BundleOptions<C>): TransformResult;468 469/**470 * Bundles a CSS file and its dependencies asynchronously, inlining @import rules.471 */472export declare function bundleAsync<C extends CustomAtRules>(options: BundleAsyncOptions<C>): Promise<TransformResult>;473 474/**475 * Composes multiple visitor objects into a single one.476 */477export declare function composeVisitors<C extends CustomAtRules>(visitors: Visitor<C>[]): Visitor<C>;478 