Skip to content

Commit 7087d29

Browse files
PierrciSBrandeis
andauthored
No more text2text (#1590)
Heads up this is pure vibe-coding _pre-LLM_, i.e. I'm not sure what I'm doing but I'm still doing it, manually (though I tried to take inspiration from #457) The goal is to address https://discuss.huggingface.co/t/no-0-models-returned-by-text2text-search-filter/161546 following huggingface-internal/moon-landing#14258 --------- Co-authored-by: SBrandeis <[email protected]>
1 parent 5fa8667 commit 7087d29

File tree

13 files changed

+12
-147
lines changed

13 files changed

+12
-147
lines changed

packages/inference/src/snippets/getInferenceSnippets.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,6 @@ const HF_JS_METHODS: Partial<Record<WidgetType, string>> = {
122122
"table-question-answering": "tableQuestionAnswering",
123123
"text-classification": "textClassification",
124124
"text-generation": "textGeneration",
125-
"text2text-generation": "textGeneration",
126125
"token-classification": "tokenClassification",
127126
"text-to-speech": "textToSpeech",
128127
translation: "translation",
@@ -361,7 +360,6 @@ const snippets: Partial<
361360
"text-to-image": snippetGenerator("textToImage"),
362361
"text-to-speech": snippetGenerator("textToSpeech"),
363362
"text-to-video": snippetGenerator("textToVideo"),
364-
"text2text-generation": snippetGenerator("basic"),
365363
"token-classification": snippetGenerator("basic"),
366364
translation: snippetGenerator("basic"),
367365
"zero-shot-classification": snippetGenerator("zeroShotClassification"),

packages/inference/test/InferenceClient.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1429,7 +1429,7 @@ describe.skip("InferenceClient", () => {
14291429
providerId: "mistralai/Devstral-Small-2505",
14301430
hfModelId: "mistralai/Devstral-Small-2505",
14311431
status: "live",
1432-
task: "text2text-generation",
1432+
task: "text-generation",
14331433
},
14341434
};
14351435

@@ -1479,7 +1479,7 @@ describe.skip("InferenceClient", () => {
14791479
expect(res[0]).toEqual(expect.arrayContaining([expect.any(Number)]));
14801480
});
14811481

1482-
it("text2textGeneration", async () => {
1482+
it("textGeneration", async () => {
14831483
const res = await client.textGeneration({
14841484
model: "mistralai/Devstral-Small-2505",
14851485
provider: "nebius",

packages/tasks/src/library-to-tasks.ts

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -35,13 +35,7 @@ export const LIBRARY_TASK_MAPPING: Partial<Record<ModelLibraryKey, PipelineType[
3535
sklearn: ["tabular-classification", "tabular-regression", "text-classification"],
3636
spacy: ["token-classification", "text-classification", "sentence-similarity"],
3737
"span-marker": ["token-classification"],
38-
speechbrain: [
39-
"audio-classification",
40-
"audio-to-audio",
41-
"automatic-speech-recognition",
42-
"text-to-speech",
43-
"text2text-generation",
44-
],
38+
speechbrain: ["audio-classification", "audio-to-audio", "automatic-speech-recognition", "text-to-speech"],
4539
stanza: ["token-classification"],
4640
timm: ["image-classification", "image-feature-extraction"],
4741
transformers: [
@@ -62,7 +56,6 @@ export const LIBRARY_TASK_MAPPING: Partial<Record<ModelLibraryKey, PipelineType[
6256
"question-answering",
6357
"summarization",
6458
"table-question-answering",
65-
"text2text-generation",
6659
"text-classification",
6760
"text-generation",
6861
"text-to-audio",

packages/tasks/src/pipelines.ts

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -237,12 +237,6 @@ export const PIPELINE_DATA = {
237237
type: "language-modeling",
238238
name: "Language Modeling",
239239
},
240-
],
241-
modality: "nlp",
242-
},
243-
"text2text-generation": {
244-
name: "Text2Text Generation",
245-
subtasks: [
246240
{
247241
type: "text-simplification",
248242
name: "Text simplification",
@@ -271,6 +265,10 @@ export const PIPELINE_DATA = {
271265
type: "closed-book-qa",
272266
name: "Closed Book QA",
273267
},
268+
{
269+
type: "text2text-generation",
270+
name: "Text2Text Generation",
271+
},
274272
],
275273
modality: "nlp",
276274
},

packages/tasks/src/snippets/inputs.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,6 @@ const inputsTextGeneration = (model: ModelDataMinimal): string | ChatCompletionI
6666
return `"Can you please let us know more details about your "`;
6767
};
6868

69-
const inputsText2TextGeneration = () => `"The answer to the universe is"`;
70-
7169
const inputsFillMask = (model: ModelDataMinimal) => `"The answer to the universe is ${model.mask_token}."`;
7270

7371
const inputsSentenceSimilarity = () =>
@@ -147,7 +145,6 @@ const modelInputSnippets: {
147145
"text-to-video": inputsTextToVideo,
148146
"text-to-speech": inputsTextToSpeech,
149147
"text-to-audio": inputsTextToAudio,
150-
"text2text-generation": inputsText2TextGeneration,
151148
"token-classification": inputsTokenClassification,
152149
translation: inputsTranslation,
153150
"zero-shot-classification": inputsZeroShotClassification,

packages/tasks/src/tasks/index.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,6 @@ export const TASKS_MODEL_LIBRARIES: Record<PipelineType, ModelLibraryKey[]> = {
158158
"text-to-speech": ["espnet", "tensorflowtts", "transformers", "transformers.js"],
159159
"text-to-audio": ["transformers", "transformers.js"],
160160
"text-to-video": ["diffusers"],
161-
"text2text-generation": ["transformers", "transformers.js"],
162161
"time-series-forecasting": [],
163162
"token-classification": [
164163
"adapter-transformers",
@@ -245,7 +244,6 @@ export const TASKS_DATA: Record<PipelineType, TaskData | undefined> = {
245244
"text-to-speech": getData("text-to-speech", textToSpeech),
246245
"text-to-audio": undefined,
247246
"text-to-video": getData("text-to-video", textToVideo),
248-
"text2text-generation": undefined,
249247
"time-series-forecasting": undefined,
250248
"token-classification": getData("token-classification", tokenClassification),
251249
translation: getData("translation", translation),

packages/tasks/src/tasks/placeholder/data.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ const taskData: TaskDataCustom = {
1414
widgetModels: [],
1515
youtubeId: undefined,
1616
/// If this is a subtask, link to the most general task ID
17-
/// (eg, text2text-generation is the canonical ID of translation)
17+
/// (eg, text-generation is the canonical ID of text-simplification)
1818
canonicalId: undefined,
1919
};
2020

packages/tasks/src/tasks/summarization/data.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import type { TaskDataCustom } from "../index.js";
22

33
const taskData: TaskDataCustom = {
4-
canonicalId: "text2text-generation",
4+
canonicalId: "text-generation",
55
datasets: [
66
{
77
description:

packages/tasks/src/tasks/text-generation/about.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
This task covers guides on both [text-generation](https://huggingface.co/models?pipeline_tag=text-generation&sort=downloads) and [text-to-text generation](https://huggingface.co/models?pipeline_tag=text2text-generation&sort=downloads) models. Popular large language models that are used for chats or following instructions are also covered in this task. You can find the list of selected open-source large language models [here](https://huggingface.co/spaces/open-llm-leaderboard/open_llm_leaderboard), ranked by their performance scores.
1+
This task covers guides on both [text-generation](https://huggingface.co/models?pipeline_tag=text-generation&sort=downloads) and [text-to-text generation](https://huggingface.co/models?other=text2text-generation&sort=downloads) models. Popular large language models that are used for chats or following instructions are also covered in this task. You can find the list of selected open-source large language models [here](https://huggingface.co/spaces/open-llm-leaderboard/open_llm_leaderboard), ranked by their performance scores.
22

33
## Use Cases
44

@@ -58,7 +58,7 @@ generator("Hello, I'm a language model", max_length = 30, num_return_sequences=3
5858
## {'generated_text': "Hello, I'm a language modeler. I write and maintain software in Python. I love to code, and that includes coding things that require writing"}, ...
5959
```
6060

61-
[Text-to-Text generation models](https://huggingface.co/models?pipeline_tag=text2text-generation&sort=downloads) have a separate pipeline called `text2text-generation`. This pipeline takes an input containing the sentence including the task and returns the output of the accomplished task.
61+
[Text-to-Text generation models](https://huggingface.co/models?other=text2text-generation&sort=downloads) have a separate pipeline called `text2text-generation`. This pipeline takes an input containing the sentence including the task and returns the output of the accomplished task.
6262

6363
```python
6464
from transformers import pipeline

packages/tasks/src/tasks/text2text-generation/inference.ts

Lines changed: 0 additions & 51 deletions
This file was deleted.

0 commit comments

Comments
 (0)