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
1// @flow2 3type Exclude<A, B> = A;4// see https://gist.github.com/thecotne/6e5969f4aaf8f253985ed36b30ac9fe05type $FlowGen$If<X: boolean, Then, Else = empty> = $Call<6 ((true, Then, Else) => Then) & ((false, Then, Else) => Else),7 X,8 Then,9 Else10>;11 12type $FlowGen$Assignable<A, B> = $Call<13 ((...r: [B]) => true) & ((...r: [A]) => false),14 A15>;16 17import type {18 Angle,19 CssColor,20 Rule,21 CustomProperty,22 EnvironmentVariable,23 Function,24 Image,25 LengthValue,26 MediaQuery,27 Declaration,28 Ratio,29 Resolution,30 Selector,31 SupportsCondition,32 Time,33 Token,34 TokenOrValue,35 UnknownAtRule,36 Url,37 Variable,38 StyleRule,39 DeclarationBlock,40 ParsedComponent,41 Multiplier,42 StyleSheet,43 Location2,44} from "./ast.js.flow";45import { Targets, Features } from "./targets.js.flow";46declare export * from "./ast.js.flow";47declare export { Targets, Features };48export type TransformOptions<C: CustomAtRules> = {|49 /**50 * The filename being transformed. Used for error messages and source maps.51 */52 filename: string,53 54 /**55 * The source code to transform.56 */57 code: Uint8Array,58 59 /**60 * Whether to enable minification.61 */62 minify?: boolean,63 64 /**65 * Whether to output a source map.66 */67 sourceMap?: boolean,68 69 /**70 * An input source map to extend.71 */72 inputSourceMap?: string,73 74 /**75 * An optional project root path, used as the source root in the output source map.76 * Also used to generate relative paths for sources used in CSS module hashes.77 */78 projectRoot?: string,79 80 /**81 * The browser targets for the generated code.82 */83 targets?: Targets,84 85 /**86 * Features that should always be compiled, even when supported by targets.87 */88 include?: number,89 90 /**91 * Features that should never be compiled, even when unsupported by targets.92 */93 exclude?: number,94 95 /**96 * Whether to enable parsing various draft syntax.97 */98 drafts?: Drafts,99 100 /**101 * Whether to enable various non-standard syntax.102 */103 nonStandard?: NonStandard,104 105 /**106 * Whether to compile this file as a CSS module.107 */108 cssModules?: boolean | CSSModulesConfig,109 110 /**111 * Whether to analyze dependencies (e.g. string).112 * When enabled, string dependencies113 * are replaced with hashed placeholders that can be replaced with the final114 * urls later (after bundling). Dependencies are returned as part of the result.115 */116 analyzeDependencies?: boolean | DependencyOptions,117 118 /**119 * Replaces user action pseudo classes with class names that can be applied from JavaScript.120 * This is useful for polyfills, for example.121 */122 pseudoClasses?: PseudoClasses,123 124 /**125 * A list of class names, ids, and custom identifiers (e.g. @keyframes) that are known126 * to be unused. These will be removed during minification. Note that these are not127 * selectors but individual names (without any . or # prefixes).128 */129 unusedSymbols?: string[],130 131 /**132 * Whether to ignore invalid rules and declarations rather than erroring.133 * When enabled, warnings are returned, and the invalid rule or declaration is134 * omitted from the output code.135 */136 errorRecovery?: boolean,137 138 /**139 * An AST visitor object. This allows custom transforms or analysis to be implemented in JavaScript.140 * Multiple visitors can be composed into one using the string function.141 * For optimal performance, visitors should be as specific as possible about what types of values142 * they care about so that JavaScript has to be called as little as possible.143 */144 visitor?: Visitor<C>,145 146 /**147 * Defines how to parse custom CSS at-rules. Each at-rule can have a prelude, defined using a CSS148 * [syntax string](https://drafts.css-houdini.org/css-properties-values-api/#syntax-strings), and149 * a block body. The body can be a declaration list, rule list, or style block as defined in the150 * [css spec](https://drafts.csswg.org/css-syntax/#declaration-rule-list).151 */152 customAtRules?: C,153|};154declare type PropertyStart =155 | "-"156 | "_"157 | "a"158 | "b"159 | "c"160 | "d"161 | "e"162 | "f"163 | "g"164 | "h"165 | "i"166 | "j"167 | "k"168 | "l"169 | "m"170 | "n"171 | "o"172 | "p"173 | "q"174 | "r"175 | "s"176 | "t"177 | "u"178 | "v"179 | "w"180 | "x"181 | "y"182 | "z";183export type ReturnedDeclaration =184 | Declaration185 | {|186 /**187 * The property name.188 */189 property: string,190 191 /**192 * The raw string value for the declaration.193 */194 raw: string,195 |};196export type ReturnedMediaQuery =197 | MediaQuery198 | {|199 /**200 * The raw string value for the media query.201 */202 raw: string,203 |};204declare type FindByType<Union, Name> = $FlowGen$If<205 $FlowGen$Assignable<206 Union,207 {|208 type: Name,209 |}210 >,211 Union,212 empty213>;214export type ReturnedRule = Rule<ReturnedDeclaration, ReturnedMediaQuery>;215declare type RequiredValue<Rule> = $FlowGen$If<216 $FlowGen$Assignable<217 Rule,218 {|219 value: { [key: string]: any },220 |}221 >,222 $FlowGen$If<223 $FlowGen$Assignable<$PropertyType<Rule, "value">, StyleRule>,224 {|225 ...Rule,226 ...{|227 value: {|228 ...Required<StyleRule>,229 ...{|230 declarations: Required<DeclarationBlock>,231 |},232 |},233 |},234 |},235 {|236 ...Rule,237 ...{|238 value: Required<$PropertyType<Rule, "value">>,239 |},240 |}241 >,242 Rule243>;244declare type RuleVisitor<R = RequiredValue<Rule>> = (245 rule: R246) => ReturnedRule | ReturnedRule[] | void;247declare type MappedRuleVisitors = $ObjMapi<248 { [k: Exclude<$PropertyType<Rule, "type">, "unknown" | "custom">]: any },249 <Name>(Name) => RuleVisitor<RequiredValue<FindByType<Rule, Name>>>250>;251declare type UnknownVisitors<T> = {252 [name: string]: RuleVisitor<T>,253};254declare type CustomVisitors<T: CustomAtRules> = $ObjMapi<255 T,256 <Name>(Name) => RuleVisitor<CustomAtRule<Name, $ElementType<T, Name>>>257>;258declare type AnyCustomAtRule<C: CustomAtRules> = $ElementType<259 $ObjMapi<C, <Key>(Key) => CustomAtRule<Key, $ElementType<C, Key>>>,260 $Keys<C>261>;262declare type RuleVisitors<C: CustomAtRules> = {|263 ...MappedRuleVisitors,264 ...{|265 unknown?:266 | UnknownVisitors<UnknownAtRule>267 | $Diff<268 RuleVisitor<UnknownAtRule>,269 { [key: $Keys<CallableFunction>]: any }270 >,271 custom?:272 | CustomVisitors<C>273 | $Diff<274 RuleVisitor<AnyCustomAtRule<C>>,275 { [key: $Keys<CallableFunction>]: any }276 >,277 |},278|};279declare type PreludeTypes = Exclude<280 $PropertyType<ParsedComponent, "type">,281 "literal" | "repeated" | "token"282>;283declare type SyntaxString = string | string;284declare type ComponentTypes = $ObjMapi<285 { [k: PreludeTypes]: any },286 <Key>(Key) => FindByType<ParsedComponent, Key>287>;288declare type Repetitions = $ObjMapi<289 { [k: PreludeTypes]: any },290 <Key>(Key) => {|291 type: "repeated",292 value: {|293 components: FindByType<ParsedComponent, Key>[],294 multiplier: Multiplier,295 |},296 |}297>;298declare type MappedPrelude = {| ...ComponentTypes, ...Repetitions |};299declare type MappedBody<P: $PropertyType<CustomAtRuleDefinition, "body">> =300 $FlowGen$If<$FlowGen$Assignable<P, "style-block">, "rule-list", P>;301declare type CustomAtRule<N, R: CustomAtRuleDefinition> = {|302 name: N,303 prelude: $FlowGen$If<304 $FlowGen$Assignable<$PropertyType<R, "prelude">, $Keys<MappedPrelude>>,305 $ElementType<MappedPrelude, $PropertyType<R, "prelude">>,306 ParsedComponent307 >,308 body: FindByType<CustomAtRuleBody, MappedBody<$PropertyType<R, "body">>>,309 loc: Location2,310|};311declare type CustomAtRuleBody =312 | {|313 type: "declaration-list",314 value: Required<DeclarationBlock>,315 |}316 | {|317 type: "rule-list",318 value: RequiredValue<Rule>[],319 |};320declare type FindProperty<Union, Name> = $FlowGen$If<321 $FlowGen$Assignable<322 Union,323 {|324 property: Name,325 |}326 >,327 Union,328 empty329>;330declare type DeclarationVisitor<P = Declaration> = (331 property: P332) => ReturnedDeclaration | ReturnedDeclaration[] | void;333declare type MappedDeclarationVisitors = $ObjMapi<334 {335 [k: Exclude<336 $PropertyType<Declaration, "property">,337 "unparsed" | "custom"338 >]: any,339 },340 <Name>(341 Name342 ) => DeclarationVisitor<343 FindProperty<Declaration, Name> | FindProperty<Declaration, "unparsed">344 >345>;346declare type CustomPropertyVisitors = {347 [name: string]: DeclarationVisitor<CustomProperty>,348};349declare type DeclarationVisitors = {|350 ...MappedDeclarationVisitors,351 ...{|352 custom?: CustomPropertyVisitors | DeclarationVisitor<CustomProperty>,353 |},354|};355declare type RawValue = {|356 /**357 * A raw string value which will be parsed like CSS.358 */359 raw: string,360|};361declare type TokenReturnValue = TokenOrValue | TokenOrValue[] | RawValue | void;362declare type TokenVisitor = (token: Token) => TokenReturnValue;363declare type VisitableTokenTypes =364 | "ident"365 | "at-keyword"366 | "hash"367 | "id-hash"368 | "string"369 | "number"370 | "percentage"371 | "dimension";372declare type TokenVisitors = $ObjMapi<373 { [k: VisitableTokenTypes]: any },374 <Name>(Name) => (token: FindByType<Token, Name>) => TokenReturnValue375>;376declare type FunctionVisitor = (fn: Function) => TokenReturnValue;377declare type EnvironmentVariableVisitor = (378 env: EnvironmentVariable379) => TokenReturnValue;380declare type EnvironmentVariableVisitors = {381 [name: string]: EnvironmentVariableVisitor,382};383export type Visitor<C: CustomAtRules> = {|384 StyleSheet?: (385 stylesheet: StyleSheet386 ) => StyleSheet<ReturnedDeclaration, ReturnedMediaQuery> | void,387 StyleSheetExit?: (388 stylesheet: StyleSheet389 ) => StyleSheet<ReturnedDeclaration, ReturnedMediaQuery> | void,390 Rule?: RuleVisitor<> | RuleVisitors<C>,391 RuleExit?: RuleVisitor<> | RuleVisitors<C>,392 Declaration?: DeclarationVisitor<> | DeclarationVisitors,393 DeclarationExit?: DeclarationVisitor<> | DeclarationVisitors,394 Url?: (url: Url) => Url | void,395 Color?: (color: CssColor) => CssColor | void,396 Image?: (image: Image) => Image | void,397 ImageExit?: (image: Image) => Image | void,398 Length?: (length: LengthValue) => LengthValue | void,399 Angle?: (angle: Angle) => Angle | void,400 Ratio?: (ratio: Ratio) => Ratio | void,401 Resolution?: (resolution: Resolution) => Resolution | void,402 Time?: (time: Time) => Time | void,403 CustomIdent?: (ident: string) => string | void,404 DashedIdent?: (ident: string) => string | void,405 MediaQuery?: (406 query: MediaQuery407 ) => ReturnedMediaQuery | ReturnedMediaQuery[] | void,408 MediaQueryExit?: (409 query: MediaQuery410 ) => ReturnedMediaQuery | ReturnedMediaQuery[] | void,411 SupportsCondition?: (condition: SupportsCondition) => SupportsCondition,412 SupportsConditionExit?: (condition: SupportsCondition) => SupportsCondition,413 Selector?: (selector: Selector) => Selector | Selector[] | void,414 Token?: TokenVisitor | TokenVisitors,415 Function?:416 | FunctionVisitor417 | {418 [name: string]: FunctionVisitor,419 },420 FunctionExit?:421 | FunctionVisitor422 | {423 [name: string]: FunctionVisitor,424 },425 Variable?: (variable: Variable) => TokenReturnValue,426 VariableExit?: (variable: Variable) => TokenReturnValue,427 EnvironmentVariable?:428 | EnvironmentVariableVisitor429 | EnvironmentVariableVisitors,430 EnvironmentVariableExit?:431 | EnvironmentVariableVisitor432 | EnvironmentVariableVisitors,433|};434export type CustomAtRules = {|435 [name: string]: CustomAtRuleDefinition,436|};437export type CustomAtRuleDefinition = {|438 /**439 * Defines the syntax for a custom at-rule prelude. The value should be a440 * CSS [syntax string](https://drafts.css-houdini.org/css-properties-values-api/#syntax-strings)441 * representing the types of values that are accepted. This property may be omitted or442 * set to null to indicate that no prelude is accepted.443 */444 prelude?: SyntaxString | null,445 446 /**447 * Defines the type of body contained within the at-rule block.448 * - declaration-list: A CSS declaration list, as in a style rule.449 * - rule-list: A list of CSS rules, as supported within a non-nested450 * at-rule such as string.451 * - style-block: Both a declaration list and rule list, as accepted within452 * a nested at-rule within a style rule (e.g. string inside a style rule453 * with directly nested declarations).454 */455 body?: "declaration-list" | "rule-list" | "style-block" | null,456|};457export type DependencyOptions = {|458 /**459 * Whether to preserve string rules rather than removing them.460 */461 preserveImports?: boolean,462|};463export type BundleOptions<C: CustomAtRules> = $Diff<464 TransformOptions<C>,465 {| code: any |}466>;467export type BundleAsyncOptions<C: CustomAtRules> = {|468 ...$Exact<BundleOptions<C>>,469 470 resolver?: Resolver,471|};472 473/**474 * Custom resolver to use when loading CSS files.475 */476export type Resolver = {|477 /**478 * Read the given file and return its contents as a string.479 */480 read?: (file: string) => string | Promise<string>,481 482 /**483 * Resolve the given CSS import specifier from the provided originating file to a484 * path which gets passed to string.485 */486 resolve?: (487 specifier: string,488 originatingFile: string489 ) => string | Promise<string>,490|};491export type Drafts = {|492 /**493 * Whether to enable @custom-media rules.494 */495 customMedia?: boolean,496|};497export type NonStandard = {|498 /**499 * Whether to enable the non-standard >>> and /deep/ selector combinators used by Angular and Vue.500 */501 deepSelectorCombinator?: boolean,502|};503export type PseudoClasses = {|504 hover?: string,505 active?: string,506 focus?: string,507 focusVisible?: string,508 focusWithin?: string,509|};510export type TransformResult = {|511 /**512 * The transformed code.513 */514 code: Uint8Array,515 516 /**517 * The generated source map, if enabled.518 */519 map: Uint8Array | void,520 521 /**522 * CSS module exports, if enabled.523 */524 exports: CSSModuleExports | void,525 526 /**527 * CSS module references, if string is enabled.528 */529 references: CSSModuleReferences,530 531 /**532 * string dependencies, if enabled.533 */534 dependencies: Dependency[] | void,535 536 /**537 * Warnings that occurred during compilation.538 */539 warnings: Warning[],540|};541export type Warning = {|542 message: string,543 type: string,544 value?: any,545 loc: ErrorLocation,546|};547export type CSSModulesConfig = {|548 /**549 * The pattern to use when renaming class names and other identifiers. Default is string.550 */551 pattern?: string,552 553 /**554 * Whether to rename dashed identifiers, e.g. custom properties.555 */556 dashedIdents?: boolean,557 558 /**559 * Whether to enable hashing for string.560 */561 animation?: boolean,562 563 /**564 * Whether to enable hashing for CSS grid identifiers.565 */566 grid?: boolean,567 568 /**569 * Whether to enable hashing for string names.570 */571 container?: boolean,572 573 /**574 * Whether to enable hashing for custom identifiers.575 */576 customIdents?: boolean,577 578 /**579 * Whether to require at least one class or id selector in each rule.580 */581 pure?: boolean,582|};583export type CSSModuleExports = {584 /**585 * Maps exported (i.e. original) names to local names.586 */587 [name: string]: CSSModuleExport,588};589export type CSSModuleExport = {|590 /**591 * The local (compiled) name for this export.592 */593 name: string,594 595 /**596 * Whether the export is referenced in this file.597 */598 isReferenced: boolean,599 600 /**601 * Other names that are composed by this export.602 */603 composes: CSSModuleReference[],604|};605export type CSSModuleReferences = {606 /**607 * Maps placeholder names to references.608 */609 [name: string]: DependencyCSSModuleReference,610};611export type CSSModuleReference =612 | LocalCSSModuleReference613 | GlobalCSSModuleReference614 | DependencyCSSModuleReference;615export type LocalCSSModuleReference = {|616 type: "local",617 618 /**619 * The local (compiled) name for the reference.620 */621 name: string,622|};623export type GlobalCSSModuleReference = {|624 type: "global",625 626 /**627 * The referenced global name.628 */629 name: string,630|};631export type DependencyCSSModuleReference = {|632 type: "dependency",633 634 /**635 * The name to reference within the dependency.636 */637 name: string,638 639 /**640 * The dependency specifier for the referenced file.641 */642 specifier: string,643|};644export type Dependency = ImportDependency | UrlDependency;645export type ImportDependency = {|646 type: "import",647 648 /**649 * The url of the string dependency.650 */651 url: string,652 653 /**654 * The media query for the string rule.655 */656 media: string | null,657 658 /**659 * The string rule.660 */661 supports: string | null,662 663 /**664 * The source location where the string rule was found.665 */666 loc: SourceLocation,667 668 /**669 * The placeholder that the import was replaced with.670 */671 placeholder: string,672|};673export type UrlDependency = {|674 type: "url",675 676 /**677 * The url of the dependency.678 */679 url: string,680 681 /**682 * The source location where the string was found.683 */684 loc: SourceLocation,685 686 /**687 * The placeholder that the url was replaced with.688 */689 placeholder: string,690|};691export type SourceLocation = {|692 /**693 * The file path in which the dependency exists.694 */695 filePath: string,696 697 /**698 * The start location of the dependency.699 */700 start: Location,701 702 /**703 * The end location (inclusive) of the dependency.704 */705 end: Location,706|};707export type Location = {|708 /**709 * The line number (1-based).710 */711 line: number,712 713 /**714 * The column number (0-based).715 */716 column: number,717|};718export type ErrorLocation = {|719 ...$Exact<Location>,720 721 filename: string,722|};723 724/**725 * Compiles a CSS file, including optionally minifying and lowering syntax to the given726 * targets. A source map may also be generated, but this is not enabled by default.727 */728declare export function transform<C: CustomAtRules>(729 options: TransformOptions<C>730): TransformResult;731export type TransformAttributeOptions = {|732 /**733 * The filename in which the style attribute appeared. Used for error messages and dependencies.734 */735 filename?: string,736 737 /**738 * The source code to transform.739 */740 code: Uint8Array,741 742 /**743 * Whether to enable minification.744 */745 minify?: boolean,746 747 /**748 * The browser targets for the generated code.749 */750 targets?: Targets,751 752 /**753 * Whether to analyze string dependencies.754 * When enabled, string dependencies are replaced with hashed placeholders755 * that can be replaced with the final urls later (after bundling).756 * Dependencies are returned as part of the result.757 */758 analyzeDependencies?: boolean,759 760 /**761 * Whether to ignore invalid rules and declarations rather than erroring.762 * When enabled, warnings are returned, and the invalid rule or declaration is763 * omitted from the output code.764 */765 errorRecovery?: boolean,766 767 /**768 * An AST visitor object. This allows custom transforms or analysis to be implemented in JavaScript.769 * Multiple visitors can be composed into one using the string function.770 * For optimal performance, visitors should be as specific as possible about what types of values771 * they care about so that JavaScript has to be called as little as possible.772 */773 visitor?: Visitor<empty>,774|};775export type TransformAttributeResult = {|776 /**777 * The transformed code.778 */779 code: Uint8Array,780 781 /**782 * string dependencies, if enabled.783 */784 dependencies: Dependency[] | void,785 786 /**787 * Warnings that occurred during compilation.788 */789 warnings: Warning[],790|};791 792/**793 * Compiles a single CSS declaration list, such as an inline style attribute in HTML.794 */795declare export function transformStyleAttribute(796 options: TransformAttributeOptions797): TransformAttributeResult;798 799/**800 * Converts a browserslist result into targets that can be passed to lightningcss.801 * @param browserslist the result of calling string802 */803declare export function browserslistToTargets(browserslist: string[]): Targets;804 805/**806 * Bundles a CSS file and its dependencies, inlining @import rules.807 */808declare export function bundle<C: CustomAtRules>(809 options: BundleOptions<C>810): TransformResult;811 812/**813 * Bundles a CSS file and its dependencies asynchronously, inlining @import rules.814 */815declare export function bundleAsync<C: CustomAtRules>(816 options: BundleAsyncOptions<C>817): Promise<TransformResult>;818 819/**820 * Composes multiple visitor objects into a single one.821 */822declare export function composeVisitors<C: CustomAtRules>(823 visitors: Visitor<C>[]824): Visitor<C>;825 