Skip to content

Commit 79b7a15

Browse files
authored
Merge branch 'main' into add-video-to-video
2 parents ec2f259 + 50076ec commit 79b7a15

File tree

7 files changed

+32
-18
lines changed

7 files changed

+32
-18
lines changed

packages/hub/src/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ export type {
1818
SpaceStage,
1919
} from "./types/public";
2020
export { HubApiError, InvalidApiResponseFormatError } from "./error";
21+
export { HUB_URL } from "./consts";
2122
/**
2223
* Only exported for E2Es convenience
2324
*/

packages/inference/src/providers/featherless-ai.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import type {
77
import { InferenceOutputError } from "../lib/InferenceOutputError.js";
88
import type { BodyParams } from "../types.js";
99
import { BaseConversationalTask, BaseTextGenerationTask } from "./providerHelper.js";
10+
import { omit } from "../utils/omit.js";
1011

1112
interface FeatherlessAITextCompletionOutput extends Omit<ChatCompletionOutput, "choices"> {
1213
choices: Array<{
@@ -33,9 +34,14 @@ export class FeatherlessAITextGenerationTask extends BaseTextGenerationTask {
3334

3435
override preparePayload(params: BodyParams<TextGenerationInput>): Record<string, unknown> {
3536
return {
36-
...params.args,
37-
...params.args.parameters,
3837
model: params.model,
38+
...omit(params.args, ["inputs", "parameters"]),
39+
...(params.args.parameters
40+
? {
41+
max_tokens: params.args.parameters.max_new_tokens,
42+
...omit(params.args.parameters, "max_new_tokens"),
43+
}
44+
: undefined),
3945
prompt: params.args.inputs,
4046
};
4147
}

packages/ollama-utils/src/chat-template-automap.ts

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5,19 +5,9 @@ import type { OllamaChatTemplateMapEntry } from "./types";
55

66
/**
77
* Skipped these models due to error:
8+
* - library/llama4:latest
89
* - library/llama3.1:latest
9-
* - library/gemma3:latest
10-
* - library/llama3.3:70b
11-
* - library/command-r-plus:latest
12-
* - library/codeqwen:latest
13-
* - library/bakllava:latest
14-
* - library/command-r-plus:latest
15-
* - library/qwen2-math:1.5b
16-
* - library/reflection:latest
17-
* - library/deepscaler:1.5b
18-
* - library/nemotron:latest
19-
* - library/nemotron:70b
20-
* - library/tulu3:latest
10+
* - library/granite3.2:latest
2111
*/
2212

2313
export const OLLAMA_CHAT_TEMPLATE_MAPPING: OllamaChatTemplateMapEntry[] = [
@@ -337,6 +327,15 @@ export const OLLAMA_CHAT_TEMPLATE_MAPPING: OllamaChatTemplateMapEntry[] = [
337327
},
338328
},
339329
},
330+
{
331+
model: "library/devstral:latest",
332+
gguf: "{%- set today = strftime_now(\"%Y-%m-%d\") %}\n{%- set default_system_message = \"You are Devstral, a Large Language Model (LLM) created by Mistral AI, a French startup headquartered in Paris.\\nYour knowledge base was last updated on 2023-10-01. The current date is \" + today + \".\\n\\nWhen you're not sure about some information, you say that you don't have the information and don't make up anything.\\nIf the user's question is not clear, ambiguous, or does not provide enough context for you to accurately answer the question, you do not try to answer it right away and you rather ask the user to clarify their request (e.g. \\\"What are some good restaurants around me?\\\" => \\\"Where are you?\\\" or \\\"When is the next flight to Tokyo\\\" => \\\"Where do you travel from?\\\")\" %}\n\n{{- bos_token }}\n\n{%- if messages[0]['role'] == 'system' %}\n {%- set system_message = messages[0]['content'] %}\n {%- set loop_messages = messages[1:] %}\n{%- else %}\n {%- set system_message = default_system_message %}\n {%- set loop_messages = messages %}\n{%- endif %}\n{{- '[SYSTEM_PROMPT]' + system_message + '[/SYSTEM_PROMPT]' }}\n\n{%- for message in loop_messages %}\n {%- if message['role'] == 'user' %}\n {{- '[INST]' + message['content'] + '[/INST]' }}\n {%- elif message['role'] == 'system' %}\n {{- '[SYSTEM_PROMPT]' + message['content'] + '[/SYSTEM_PROMPT]' }}\n {%- elif message['role'] == 'assistant' %}\n {{- message['content'] + eos_token }}\n {%- else %}\n {{- raise_exception('Only user, system and assistant roles are supported!') }}\n {%- endif %}\n{%- endfor %}",
333+
ollama: {
334+
template:
335+
'{{- range $index, $_ := .Messages }}\n{{- if eq .Role "system" }}[SYSTEM_PROMPT]{{ .Content }}[/SYSTEM_PROMPT]\n{{- else if eq .Role "user" }}\n{{- if and (le (len (slice $.Messages $index)) 2) $.Tools }}[AVAILABLE_TOOLS]{{ $.Tools }}[/AVAILABLE_TOOLS]\n{{- end }}[INST]{{ .Content }}[/INST]\n{{- else if eq .Role "assistant" }}\n{{- if .Content }}{{ .Content }}\n{{- if not (eq (len (slice $.Messages $index)) 1) }}</s>\n{{- end }}\n{{- else if .ToolCalls }}[TOOL_CALLS][\n{{- range .ToolCalls }}{"name": "{{ .Function.Name }}", "arguments": {{ .Function.Arguments }}}\n{{- end }}]</s>\n{{- end }}\n{{- else if eq .Role "tool" }}[TOOL_RESULTS]{"content": {{ .Content }}}[/TOOL_RESULTS]\n{{- end }}\n{{- end }}',
336+
tokens: ["[INST]"],
337+
},
338+
},
340339
{
341340
model: "library/dolphin-llama3:8b",
342341
gguf: "{% set loop_messages = messages %}{% for message in loop_messages %}{% set content = '<|start_header_id|>' + message['role'] + '<|end_header_id|>\n\n'+ message['content'] | trim + '<|eot_id|>' %}{% if loop.index0 == 0 %}{% set content = bos_token + content %}{% endif %}{{ content }}{% endfor %}{{ '<|start_header_id|>assistant<|end_header_id|>\n\n' }}",

packages/tasks-gen/scripts/generate-snippets-fixtures.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ import { existsSync as pathExists } from "node:fs";
1919
import * as fs from "node:fs/promises";
2020
import * as path from "node:path/posix";
2121

22+
import type { InferenceProviderOrPolicy } from "@huggingface/inference";
2223
import { snippets } from "@huggingface/inference";
2324
import type { InferenceSnippet, ModelDataMinimal, SnippetInferenceProvider, WidgetType } from "@huggingface/tasks";
2425
import { inferenceSnippetLanguages } from "@huggingface/tasks";
@@ -31,7 +32,7 @@ const TEST_CASES: {
3132
testName: string;
3233
task: WidgetType;
3334
model: ModelDataMinimal;
34-
providers: SnippetInferenceProvider[];
35+
providers: InferenceProviderOrPolicy[];
3536
lora?: boolean;
3637
opts?: snippets.InferenceSnippetOptions;
3738
}[] = [
@@ -306,7 +307,7 @@ function getFixtureFolder(testName: string): string {
306307
function generateInferenceSnippet(
307308
model: ModelDataMinimal,
308309
language: Language,
309-
provider: SnippetInferenceProvider,
310+
provider: InferenceProviderOrPolicy,
310311
task: WidgetType,
311312
lora: boolean = false,
312313
opts?: Record<string, unknown>

packages/tasks/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@huggingface/tasks",
33
"packageManager": "[email protected]",
4-
"version": "0.19.8",
4+
"version": "0.19.9",
55
"description": "List of ML tasks for huggingface.co/tasks",
66
"repository": "https://github.com/huggingface/huggingface.js.git",
77
"publishConfig": {

packages/tasks/src/hardware.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,10 @@ export const SKUS = {
100100
tflops: 38.7,
101101
memory: [48],
102102
},
103+
"RTX A5000": {
104+
tflops: 34.1,
105+
memory: [24],
106+
},
103107
"RTX A4000": {
104108
tflops: 19.2,
105109
memory: [16],
@@ -533,6 +537,9 @@ export const SKUS = {
533537
"Intel Core Ultra 7 265KF": {
534538
tflops: 1.53,
535539
},
540+
"Intel Core 14th Generation (i7)": {
541+
tflops: 0.8,
542+
},
536543
"Intel Core 13th Generation (i9)": {
537544
tflops: 0.85,
538545
},

packages/tasks/src/model-libraries.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -936,7 +936,7 @@ export const MODEL_LIBRARIES_UI_ELEMENTS = {
936936
repoName: "timesfm",
937937
repoUrl: "https://github.com/google-research/timesfm",
938938
filter: false,
939-
countDownloads: `path:"checkpoints/checkpoint_1100000/state/checkpoint"`,
939+
countDownloads: `path:"checkpoints/checkpoint_1100000/state/checkpoint" OR path:"checkpoints/checkpoint_2150000/state/checkpoint" OR path_extension:"ckpt"`,
940940
},
941941
timm: {
942942
prettyLabel: "timm",

0 commit comments

Comments
 (0)