Spaces:
Sleeping
Sleeping
machineuser
commited on
Commit
•
28fb656
1
Parent(s):
1e51cd1
Sync widgets demo
Browse files- packages/tasks/package.json +2 -3
- packages/tasks/{scripts → src/scripts}/inference-codegen.ts +60 -52
- packages/tasks/src/tasks/automatic-speech-recognition/about.md +3 -1
- packages/tasks/src/tasks/index.ts +4 -2
- packages/tasks/src/tasks/mask-generation/about.md +37 -6
- packages/tasks/src/tasks/text-classification/about.md +1 -0
- packages/tasks/src/tasks/text-generation/about.md +24 -13
- packages/tasks/src/tasks/text-to-image/about.md +11 -2
- packages/tasks/src/tasks/text-to-speech/about.md +2 -0
- packages/tasks/src/tasks/zero-shot-object-detection/about.md +6 -0
- packages/tasks/tsconfig.json +2 -2
packages/tasks/package.json
CHANGED
@@ -24,12 +24,11 @@
|
|
24 |
"format": "prettier --write .",
|
25 |
"format:check": "prettier --check .",
|
26 |
"prepublishOnly": "pnpm run build",
|
27 |
-
"build": "tsup src/index.ts --format cjs,esm --clean --dts
|
28 |
"prepare": "pnpm run build",
|
29 |
"check": "tsc",
|
30 |
-
"inference-codegen": "
|
31 |
},
|
32 |
-
"type": "module",
|
33 |
"files": [
|
34 |
"dist",
|
35 |
"src",
|
|
|
24 |
"format": "prettier --write .",
|
25 |
"format:check": "prettier --check .",
|
26 |
"prepublishOnly": "pnpm run build",
|
27 |
+
"build": "tsup src/index.ts src/scripts/**.ts --format cjs,esm --clean --dts",
|
28 |
"prepare": "pnpm run build",
|
29 |
"check": "tsc",
|
30 |
+
"inference-codegen": "pnpm run build && node dist/scripts/inference-codegen.js"
|
31 |
},
|
|
|
32 |
"files": [
|
33 |
"dist",
|
34 |
"src",
|
packages/tasks/{scripts → src/scripts}/inference-codegen.ts
RENAMED
@@ -1,9 +1,9 @@
|
|
1 |
import type { SerializedRenderResult } from "quicktype-core";
|
2 |
import { quicktype, InputData, JSONSchemaInput, FetchingJSONSchemaStore } from "quicktype-core";
|
3 |
-
import * as fs from "
|
4 |
-
import { existsSync as pathExists } from "
|
5 |
-
import * as path from "
|
6 |
-
import ts from "typescript";
|
7 |
|
8 |
const TYPESCRIPT_HEADER_FILE = `
|
9 |
/**
|
@@ -15,17 +15,16 @@ const TYPESCRIPT_HEADER_FILE = `
|
|
15 |
`;
|
16 |
|
17 |
const rootDirFinder = function (): string {
|
18 |
-
|
19 |
-
|
20 |
-
while (
|
21 |
-
|
22 |
-
|
|
|
23 |
}
|
24 |
-
|
25 |
-
currentPath = path.normalize(path.join(currentPath, ".."));
|
26 |
}
|
27 |
-
|
28 |
-
return "/";
|
29 |
};
|
30 |
|
31 |
/**
|
@@ -54,7 +53,6 @@ async function generateTypescript(inputData: InputData): Promise<SerializedRende
|
|
54 |
inputData,
|
55 |
lang: "typescript",
|
56 |
alphabetizeProperties: true,
|
57 |
-
indentation: "\t",
|
58 |
rendererOptions: {
|
59 |
"just-types": true,
|
60 |
"nice-property-names": true,
|
@@ -141,44 +139,54 @@ async function postProcessOutput(path2generated: string, outputSpec: Record<stri
|
|
141 |
return;
|
142 |
}
|
143 |
|
144 |
-
|
145 |
-
const
|
146 |
-
const
|
147 |
-
|
148 |
-
.
|
149 |
-
|
150 |
-
|
151 |
-
)
|
152 |
-
|
153 |
-
|
154 |
-
|
155 |
-
|
156 |
-
|
157 |
-
|
158 |
-
|
159 |
-
|
160 |
-
const
|
161 |
-
|
162 |
-
|
163 |
-
|
164 |
-
|
165 |
-
|
166 |
-
|
167 |
-
|
168 |
-
|
169 |
-
|
170 |
-
|
171 |
-
|
172 |
-
|
173 |
-
|
174 |
-
|
175 |
-
|
176 |
-
|
177 |
-
|
|
|
178 |
|
179 |
-
|
180 |
|
181 |
-
|
182 |
-
|
|
|
|
|
183 |
}
|
184 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
import type { SerializedRenderResult } from "quicktype-core";
|
2 |
import { quicktype, InputData, JSONSchemaInput, FetchingJSONSchemaStore } from "quicktype-core";
|
3 |
+
import * as fs from "fs/promises";
|
4 |
+
import { existsSync as pathExists } from "fs";
|
5 |
+
import * as path from "path";
|
6 |
+
import * as ts from "typescript";
|
7 |
|
8 |
const TYPESCRIPT_HEADER_FILE = `
|
9 |
/**
|
|
|
15 |
`;
|
16 |
|
17 |
const rootDirFinder = function (): string {
|
18 |
+
const parts = __dirname.split("/");
|
19 |
+
let level = parts.length - 1;
|
20 |
+
while (level > 0) {
|
21 |
+
const currentPath = parts.slice(0, level).join("/");
|
22 |
+
if (pathExists(`${currentPath}/package.json`)) {
|
23 |
+
return path.normalize(currentPath);
|
24 |
}
|
25 |
+
level--;
|
|
|
26 |
}
|
27 |
+
return "";
|
|
|
28 |
};
|
29 |
|
30 |
/**
|
|
|
53 |
inputData,
|
54 |
lang: "typescript",
|
55 |
alphabetizeProperties: true,
|
|
|
56 |
rendererOptions: {
|
57 |
"just-types": true,
|
58 |
"nice-property-names": true,
|
|
|
139 |
return;
|
140 |
}
|
141 |
|
142 |
+
async function main() {
|
143 |
+
const rootDir = rootDirFinder();
|
144 |
+
const tasksDir = path.join(rootDir, "src", "tasks");
|
145 |
+
const allTasks = await Promise.all(
|
146 |
+
(await fs.readdir(tasksDir, { withFileTypes: true }))
|
147 |
+
.filter((entry) => entry.isDirectory())
|
148 |
+
.filter((entry) => entry.name !== "placeholder")
|
149 |
+
.map(async (entry) => ({ task: entry.name, dirPath: path.join(entry.path, entry.name) }))
|
150 |
+
);
|
151 |
+
const allSpecFiles = [
|
152 |
+
path.join(tasksDir, "common-definitions.json"),
|
153 |
+
...allTasks
|
154 |
+
.flatMap(({ dirPath }) => [path.join(dirPath, "spec", "input.json"), path.join(dirPath, "spec", "output.json")])
|
155 |
+
.filter((filepath) => pathExists(filepath)),
|
156 |
+
];
|
157 |
+
|
158 |
+
for (const { task, dirPath } of allTasks) {
|
159 |
+
const taskSpecDir = path.join(dirPath, "spec");
|
160 |
+
if (!(pathExists(path.join(taskSpecDir, "input.json")) && pathExists(path.join(taskSpecDir, "output.json")))) {
|
161 |
+
console.debug(`No spec found for task ${task} - skipping`);
|
162 |
+
continue;
|
163 |
+
}
|
164 |
+
console.debug(`✨ Generating types for task`, task);
|
165 |
+
|
166 |
+
console.debug(" 📦 Building input data");
|
167 |
+
const inputData = await buildInputData(task, taskSpecDir, allSpecFiles);
|
168 |
+
|
169 |
+
console.debug(" 🏭 Generating typescript code");
|
170 |
+
{
|
171 |
+
const { lines } = await generateTypescript(inputData);
|
172 |
+
await fs.writeFile(`${dirPath}/inference.ts`, [TYPESCRIPT_HEADER_FILE, ...lines].join(`\n`), {
|
173 |
+
flag: "w+",
|
174 |
+
encoding: "utf-8",
|
175 |
+
});
|
176 |
+
}
|
177 |
|
178 |
+
const outputSpec = JSON.parse(await fs.readFile(`${taskSpecDir}/output.json`, { encoding: "utf-8" }));
|
179 |
|
180 |
+
console.log(" 🩹 Post-processing the generated code");
|
181 |
+
await postProcessOutput(`${dirPath}/inference.ts`, outputSpec);
|
182 |
+
}
|
183 |
+
console.debug("✅ All done!");
|
184 |
}
|
185 |
+
|
186 |
+
let exit = 0;
|
187 |
+
main()
|
188 |
+
.catch((err) => {
|
189 |
+
console.error("Failure", err);
|
190 |
+
exit = 1;
|
191 |
+
})
|
192 |
+
.finally(() => process.exit(exit));
|
packages/tasks/src/tasks/automatic-speech-recognition/about.md
CHANGED
@@ -83,6 +83,8 @@ These events help democratize ASR for all languages, including low-resource lang
|
|
83 |
- [Massively Multilingual ASR: 50 Languages, 1 Model, 1 Billion Parameters](https://arxiv.org/pdf/2007.03001.pdf)
|
84 |
- An ASR toolkit made by [NVIDIA: NeMo](https://github.com/NVIDIA/NeMo) with code and pretrained models useful for new ASR models. Watch the [introductory video](https://www.youtube.com/embed/wBgpMf_KQVw) for an overview.
|
85 |
- [An introduction to SpeechT5, a multi-purpose speech recognition and synthesis model](https://huggingface.co/blog/speecht5)
|
86 |
-
- [
|
87 |
- [Automatic speech recognition task guide](https://huggingface.co/docs/transformers/tasks/asr)
|
88 |
- [Speech Synthesis, Recognition, and More With SpeechT5](https://huggingface.co/blog/speecht5)
|
|
|
|
|
|
83 |
- [Massively Multilingual ASR: 50 Languages, 1 Model, 1 Billion Parameters](https://arxiv.org/pdf/2007.03001.pdf)
|
84 |
- An ASR toolkit made by [NVIDIA: NeMo](https://github.com/NVIDIA/NeMo) with code and pretrained models useful for new ASR models. Watch the [introductory video](https://www.youtube.com/embed/wBgpMf_KQVw) for an overview.
|
85 |
- [An introduction to SpeechT5, a multi-purpose speech recognition and synthesis model](https://huggingface.co/blog/speecht5)
|
86 |
+
- [Fine-tune Whisper For Multilingual ASR with 🤗Transformers](https://huggingface.co/blog/fine-tune-whisper)
|
87 |
- [Automatic speech recognition task guide](https://huggingface.co/docs/transformers/tasks/asr)
|
88 |
- [Speech Synthesis, Recognition, and More With SpeechT5](https://huggingface.co/blog/speecht5)
|
89 |
+
- [Fine-Tune W2V2-Bert for low-resource ASR with 🤗 Transformers](https://huggingface.co/blog/fine-tune-w2v2-bert)
|
90 |
+
- [Speculative Decoding for 2x Faster Whisper Inference](https://huggingface.co/blog/whisper-speculative-decoding)
|
packages/tasks/src/tasks/index.ts
CHANGED
@@ -11,6 +11,7 @@ import imageClassification from "./image-classification/data";
|
|
11 |
import imageToImage from "./image-to-image/data";
|
12 |
import imageToText from "./image-to-text/data";
|
13 |
import imageSegmentation from "./image-segmentation/data";
|
|
|
14 |
import objectDetection from "./object-detection/data";
|
15 |
import depthEstimation from "./depth-estimation/data";
|
16 |
import placeholder from "./placeholder/data";
|
@@ -33,6 +34,7 @@ import videoClassification from "./video-classification/data";
|
|
33 |
import visualQuestionAnswering from "./visual-question-answering/data";
|
34 |
import zeroShotClassification from "./zero-shot-classification/data";
|
35 |
import zeroShotImageClassification from "./zero-shot-image-classification/data";
|
|
|
36 |
|
37 |
import type { ModelLibraryKey } from "../model-libraries";
|
38 |
|
@@ -131,7 +133,7 @@ export const TASKS_DATA: Record<PipelineType, TaskData | undefined> = {
|
|
131 |
"image-to-image": getData("image-to-image", imageToImage),
|
132 |
"image-to-text": getData("image-to-text", imageToText),
|
133 |
"image-to-video": undefined,
|
134 |
-
"mask-generation": getData("mask-generation",
|
135 |
"multiple-choice": undefined,
|
136 |
"object-detection": getData("object-detection", objectDetection),
|
137 |
"video-classification": getData("video-classification", videoClassification),
|
@@ -162,7 +164,7 @@ export const TASKS_DATA: Record<PipelineType, TaskData | undefined> = {
|
|
162 |
"voice-activity-detection": undefined,
|
163 |
"zero-shot-classification": getData("zero-shot-classification", zeroShotClassification),
|
164 |
"zero-shot-image-classification": getData("zero-shot-image-classification", zeroShotImageClassification),
|
165 |
-
"zero-shot-object-detection": getData("zero-shot-object-detection",
|
166 |
"text-to-3d": getData("text-to-3d", placeholder),
|
167 |
"image-to-3d": getData("image-to-3d", placeholder),
|
168 |
} as const;
|
|
|
11 |
import imageToImage from "./image-to-image/data";
|
12 |
import imageToText from "./image-to-text/data";
|
13 |
import imageSegmentation from "./image-segmentation/data";
|
14 |
+
import maskGeneration from "./mask-generation/data";
|
15 |
import objectDetection from "./object-detection/data";
|
16 |
import depthEstimation from "./depth-estimation/data";
|
17 |
import placeholder from "./placeholder/data";
|
|
|
34 |
import visualQuestionAnswering from "./visual-question-answering/data";
|
35 |
import zeroShotClassification from "./zero-shot-classification/data";
|
36 |
import zeroShotImageClassification from "./zero-shot-image-classification/data";
|
37 |
+
import zeroShotObjectDetection from "./zero-shot-object-detection/data";
|
38 |
|
39 |
import type { ModelLibraryKey } from "../model-libraries";
|
40 |
|
|
|
133 |
"image-to-image": getData("image-to-image", imageToImage),
|
134 |
"image-to-text": getData("image-to-text", imageToText),
|
135 |
"image-to-video": undefined,
|
136 |
+
"mask-generation": getData("mask-generation", maskGeneration),
|
137 |
"multiple-choice": undefined,
|
138 |
"object-detection": getData("object-detection", objectDetection),
|
139 |
"video-classification": getData("video-classification", videoClassification),
|
|
|
164 |
"voice-activity-detection": undefined,
|
165 |
"zero-shot-classification": getData("zero-shot-classification", zeroShotClassification),
|
166 |
"zero-shot-image-classification": getData("zero-shot-image-classification", zeroShotImageClassification),
|
167 |
+
"zero-shot-object-detection": getData("zero-shot-object-detection", zeroShotObjectDetection),
|
168 |
"text-to-3d": getData("text-to-3d", placeholder),
|
169 |
"image-to-3d": getData("image-to-3d", placeholder),
|
170 |
} as const;
|
packages/tasks/src/tasks/mask-generation/about.md
CHANGED
@@ -6,25 +6,56 @@ When filtering for an image, the generated masks might serve as an initial filte
|
|
6 |
|
7 |
### Masked Image Modelling
|
8 |
|
9 |
-
Generating masks can
|
10 |
|
11 |
-
### Human-in-the-loop
|
12 |
|
13 |
-
For applications where humans are in the loop, masks highlight certain
|
14 |
|
15 |
## Task Variants
|
16 |
|
17 |
### Segmentation
|
18 |
|
19 |
-
Image Segmentation divides an image into segments where each pixel
|
20 |
|
21 |
## Inference
|
22 |
|
|
|
|
|
|
|
23 |
```python
|
24 |
from transformers import pipeline
|
25 |
-
|
|
|
26 |
image_url = "https://huggingface.co/ybelkada/segment-anything/resolve/main/assets/car.png"
|
27 |
-
outputs = generator(image_url
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
28 |
```
|
29 |
|
30 |
## Useful Resources
|
|
|
6 |
|
7 |
### Masked Image Modelling
|
8 |
|
9 |
+
Generating masks can facilitate learning, especially in semi or unsupervised learning. For example, the [BEiT model](https://huggingface.co/docs/transformers/model_doc/beit) uses image-mask patches in the pre-training.
|
10 |
|
11 |
+
### Human-in-the-loop Computer Vision Applications
|
12 |
|
13 |
+
For applications where humans are in the loop, masks highlight certain regions of images for humans to validate.
|
14 |
|
15 |
## Task Variants
|
16 |
|
17 |
### Segmentation
|
18 |
|
19 |
+
Image Segmentation divides an image into segments where each pixel is mapped to an object. This task has multiple variants, such as instance segmentation, panoptic segmentation, and semantic segmentation. You can learn more about segmentation on its [task page](https://huggingface.co/tasks/image-segmentation).
|
20 |
|
21 |
## Inference
|
22 |
|
23 |
+
Mask generation models often work in two modes: segment everything or prompt mode.
|
24 |
+
The example below works in segment-everything-mode, where many masks will be returned.
|
25 |
+
|
26 |
```python
|
27 |
from transformers import pipeline
|
28 |
+
|
29 |
+
generator = pipeline("mask-generation", model="Zigeng/SlimSAM-uniform-50", points_per_batch=64, device="cuda")
|
30 |
image_url = "https://huggingface.co/ybelkada/segment-anything/resolve/main/assets/car.png"
|
31 |
+
outputs = generator(image_url)
|
32 |
+
outputs["masks"]
|
33 |
+
# array of multiple binary masks returned for each generated mask
|
34 |
+
```
|
35 |
+
|
36 |
+
Prompt mode takes in three types of prompts:
|
37 |
+
|
38 |
+
- **Point prompt:** The user can select a point on the image, and a meaningful segment around the point will be returned.
|
39 |
+
- **Box prompt:** The user can draw a box on the image, and a meaningful segment within the box will be returned.
|
40 |
+
- **Text prompt:** The user can input a text, and the objects of that type will be segmented. Note that this capability has not yet been released and has only been explored in research.
|
41 |
+
|
42 |
+
Below you can see how to use an input-point prompt. It also demonstrates direct model inference without the `pipeline` abstraction. The input prompt here is a nested list where the outermost list is the batch size (`1`), then the number of points (also `1` in this example), and the innermost list contains the actual coordinates of the point (`[450, 600]`).
|
43 |
+
|
44 |
+
```python
|
45 |
+
from transformers import SamModel, SamProcessor
|
46 |
+
from PIL import Image
|
47 |
+
import requests
|
48 |
+
|
49 |
+
model = SamModel.from_pretrained("Zigeng/SlimSAM-uniform-50").to("cuda")
|
50 |
+
processor = SamProcessor.from_pretrained("Zigeng/SlimSAM-uniform-50")
|
51 |
+
|
52 |
+
raw_image = Image.open(requests.get(image_url, stream=True).raw).convert("RGB")
|
53 |
+
# pointing to the car window
|
54 |
+
input_points = [[[450, 600]]]
|
55 |
+
inputs = processor(raw_image, input_points=input_points, return_tensors="pt").to("cuda")
|
56 |
+
outputs = model(**inputs)
|
57 |
+
masks = processor.post_process_masks(outputs.pred_masks.cpu(), inputs["original_sizes"].cpu(), inputs["reshaped_input_sizes"].cpu())
|
58 |
+
scores = outputs.iou_scores
|
59 |
```
|
60 |
|
61 |
## Useful Resources
|
packages/tasks/src/tasks/text-classification/about.md
CHANGED
@@ -150,6 +150,7 @@ classifier("I will walk to home when I went through the bus.")
|
|
150 |
|
151 |
Would you like to learn more about the topic? Awesome! Here you can find some curated resources that you may find helpful!
|
152 |
|
|
|
153 |
- [Course Chapter on Fine-tuning a Text Classification Model](https://huggingface.co/course/chapter3/1?fw=pt)
|
154 |
- [Getting Started with Sentiment Analysis using Python](https://huggingface.co/blog/sentiment-analysis-python)
|
155 |
- [Sentiment Analysis on Encrypted Data with Homomorphic Encryption](https://huggingface.co/blog/sentiment-analysis-fhe)
|
|
|
150 |
|
151 |
Would you like to learn more about the topic? Awesome! Here you can find some curated resources that you may find helpful!
|
152 |
|
153 |
+
- [SetFitABSA: Few-Shot Aspect Based Sentiment Analysis using SetFit](https://huggingface.co/blog/setfit-absa)
|
154 |
- [Course Chapter on Fine-tuning a Text Classification Model](https://huggingface.co/course/chapter3/1?fw=pt)
|
155 |
- [Getting Started with Sentiment Analysis using Python](https://huggingface.co/blog/sentiment-analysis-python)
|
156 |
- [Sentiment Analysis on Encrypted Data with Homomorphic Encryption](https://huggingface.co/blog/sentiment-analysis-fhe)
|
packages/tasks/src/tasks/text-generation/about.md
CHANGED
@@ -110,25 +110,36 @@ Would you like to learn more about the topic? Awesome! Here you can find some cu
|
|
110 |
- [ChatUI Docker Spaces](https://huggingface.co/docs/hub/spaces-sdks-docker-chatui)
|
111 |
- [Causal language modeling task guide](https://huggingface.co/docs/transformers/tasks/language_modeling)
|
112 |
- [Text generation strategies](https://huggingface.co/docs/transformers/generation_strategies)
|
|
|
113 |
|
114 |
-
###
|
115 |
|
116 |
-
- [
|
117 |
-
- [
|
118 |
-
- [
|
119 |
-
- [
|
120 |
-
- [How to generate text: using different decoding methods for language generation with Transformers](https://huggingface.co/blog/how-to-generate)
|
121 |
- [Guiding Text Generation with Constrained Beam Search in 🤗 Transformers](https://huggingface.co/blog/constrained-beam-search)
|
122 |
- [Code generation with Hugging Face](https://huggingface.co/spaces/codeparrot/code-generation-models)
|
123 |
-
- [🌸 Introducing The World's Largest Open Multilingual Language Model: BLOOM 🌸](https://huggingface.co/blog/bloom)
|
124 |
-
- [The Technology Behind BLOOM Training](https://huggingface.co/blog/bloom-megatron-deepspeed)
|
125 |
-
- [Faster Text Generation with TensorFlow and XLA](https://huggingface.co/blog/tf-xla-generate)
|
126 |
- [Assisted Generation: a new direction toward low-latency text generation](https://huggingface.co/blog/assisted-generation)
|
127 |
-
- [
|
|
|
|
|
|
|
|
|
|
|
|
|
128 |
- [Creating a Coding Assistant with StarCoder](https://huggingface.co/blog/starchat-alpha)
|
129 |
-
|
130 |
-
|
131 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
132 |
|
133 |
### Notebooks
|
134 |
|
|
|
110 |
- [ChatUI Docker Spaces](https://huggingface.co/docs/hub/spaces-sdks-docker-chatui)
|
111 |
- [Causal language modeling task guide](https://huggingface.co/docs/transformers/tasks/language_modeling)
|
112 |
- [Text generation strategies](https://huggingface.co/docs/transformers/generation_strategies)
|
113 |
+
- [Course chapter on training a causal language model from scratch](https://huggingface.co/course/chapter7/6?fw=pt)
|
114 |
|
115 |
+
### Model Inference & Deployment
|
116 |
|
117 |
+
- [Optimizing your LLM in production](https://huggingface.co/blog/optimize-llm)
|
118 |
+
- [Open-Source Text Generation & LLM Ecosystem at Hugging Face](https://huggingface.co/blog/os-llms)
|
119 |
+
- [Introducing RWKV - An RNN with the advantages of a transformer](https://huggingface.co/blog/rwkv)
|
120 |
+
- [Llama 2 is at Hugging Face](https://huggingface.co/blog/llama2)
|
|
|
121 |
- [Guiding Text Generation with Constrained Beam Search in 🤗 Transformers](https://huggingface.co/blog/constrained-beam-search)
|
122 |
- [Code generation with Hugging Face](https://huggingface.co/spaces/codeparrot/code-generation-models)
|
|
|
|
|
|
|
123 |
- [Assisted Generation: a new direction toward low-latency text generation](https://huggingface.co/blog/assisted-generation)
|
124 |
+
- [How to generate text: using different decoding methods for language generation with Transformers](https://huggingface.co/blog/how-to-generate)
|
125 |
+
- [Faster Text Generation with TensorFlow and XLA](https://huggingface.co/blog/tf-xla-generate)
|
126 |
+
|
127 |
+
### Model Fine-tuning/Training
|
128 |
+
|
129 |
+
- [Non-engineers guide: Train a LLaMA 2 chatbot](https://huggingface.co/blog/Llama2-for-non-engineers)
|
130 |
+
- [Training CodeParrot 🦜 from Scratch](https://huggingface.co/blog/codeparrot)
|
131 |
- [Creating a Coding Assistant with StarCoder](https://huggingface.co/blog/starchat-alpha)
|
132 |
+
|
133 |
+
### Advanced Concepts Explained Simply
|
134 |
+
|
135 |
+
- [Mixture of Experts Explained](https://huggingface.co/blog/moe)
|
136 |
+
|
137 |
+
### Advanced Fine-tuning/Training Recipes
|
138 |
+
|
139 |
+
- [Fine-tuning Llama 2 70B using PyTorch FSDP](https://huggingface.co/blog/ram-efficient-pytorch-fsdp)
|
140 |
+
- [The N Implementation Details of RLHF with PPO](https://huggingface.co/blog/the_n_implementation_details_of_rlhf_with_ppo)
|
141 |
+
- [Preference Tuning LLMs with Direct Preference Optimization Methods](https://huggingface.co/blog/pref-tuning)
|
142 |
+
- [Fine-tune Llama 2 with DPO](https://huggingface.co/blog/dpo-trl)
|
143 |
|
144 |
### Notebooks
|
145 |
|
packages/tasks/src/tasks/text-to-image/about.md
CHANGED
@@ -53,14 +53,23 @@ await inference.textToImage({
|
|
53 |
|
54 |
## Useful Resources
|
55 |
|
|
|
|
|
56 |
- [Hugging Face Diffusion Models Course](https://github.com/huggingface/diffusion-models-class)
|
57 |
- [Getting Started with Diffusers](https://huggingface.co/docs/diffusers/index)
|
58 |
- [Text-to-Image Generation](https://huggingface.co/docs/diffusers/using-diffusers/conditional_image_generation)
|
59 |
-
- [MinImagen - Build Your Own Imagen Text-to-Image Model](https://www.assemblyai.com/blog/minimagen-build-your-own-imagen-text-to-image-model/)
|
60 |
-
- [Using LoRA for Efficient Stable Diffusion Fine-Tuning](https://huggingface.co/blog/lora)
|
61 |
- [Using Stable Diffusion with Core ML on Apple Silicon](https://huggingface.co/blog/diffusers-coreml)
|
62 |
- [A guide on Vector Quantized Diffusion](https://huggingface.co/blog/vq-diffusion)
|
63 |
- [🧨 Stable Diffusion in JAX/Flax](https://huggingface.co/blog/stable_diffusion_jax)
|
64 |
- [Running IF with 🧨 diffusers on a Free Tier Google Colab](https://huggingface.co/blog/if)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
65 |
|
66 |
This page was made possible thanks to the efforts of [Ishan Dutta](https://huggingface.co/ishandutta), [Enrique Elias Ubaldo](https://huggingface.co/herrius) and [Oğuz Akif](https://huggingface.co/oguzakif).
|
|
|
53 |
|
54 |
## Useful Resources
|
55 |
|
56 |
+
### Model Inference
|
57 |
+
|
58 |
- [Hugging Face Diffusion Models Course](https://github.com/huggingface/diffusion-models-class)
|
59 |
- [Getting Started with Diffusers](https://huggingface.co/docs/diffusers/index)
|
60 |
- [Text-to-Image Generation](https://huggingface.co/docs/diffusers/using-diffusers/conditional_image_generation)
|
|
|
|
|
61 |
- [Using Stable Diffusion with Core ML on Apple Silicon](https://huggingface.co/blog/diffusers-coreml)
|
62 |
- [A guide on Vector Quantized Diffusion](https://huggingface.co/blog/vq-diffusion)
|
63 |
- [🧨 Stable Diffusion in JAX/Flax](https://huggingface.co/blog/stable_diffusion_jax)
|
64 |
- [Running IF with 🧨 diffusers on a Free Tier Google Colab](https://huggingface.co/blog/if)
|
65 |
+
- [Introducing Würstchen: Fast Diffusion for Image Generation](https://huggingface.co/blog/wuerstchen)
|
66 |
+
- [Efficient Controllable Generation for SDXL with T2I-Adapters](https://huggingface.co/blog/t2i-sdxl-adapters)
|
67 |
+
- [Welcome aMUSEd: Efficient Text-to-Image Generation](https://huggingface.co/blog/amused)
|
68 |
+
|
69 |
+
### Model Fine-tuning
|
70 |
+
|
71 |
+
- [Finetune Stable Diffusion Models with DDPO via TRL](https://huggingface.co/blog/pref-tuning)
|
72 |
+
- [LoRA training scripts of the world, unite!](https://huggingface.co/blog/sdxl_lora_advanced_script)
|
73 |
+
- [Using LoRA for Efficient Stable Diffusion Fine-Tuning](https://huggingface.co/blog/lora)
|
74 |
|
75 |
This page was made possible thanks to the efforts of [Ishan Dutta](https://huggingface.co/ishandutta), [Enrique Elias Ubaldo](https://huggingface.co/herrius) and [Oğuz Akif](https://huggingface.co/oguzakif).
|
packages/tasks/src/tasks/text-to-speech/about.md
CHANGED
@@ -61,3 +61,5 @@ await inference.textToSpeech({
|
|
61 |
- [An introduction to SpeechT5, a multi-purpose speech recognition and synthesis model](https://huggingface.co/blog/speecht5).
|
62 |
- [A guide on Fine-tuning Whisper For Multilingual ASR with 🤗Transformers](https://huggingface.co/blog/fine-tune-whisper)
|
63 |
- [Speech Synthesis, Recognition, and More With SpeechT5](https://huggingface.co/blog/speecht5)
|
|
|
|
|
|
61 |
- [An introduction to SpeechT5, a multi-purpose speech recognition and synthesis model](https://huggingface.co/blog/speecht5).
|
62 |
- [A guide on Fine-tuning Whisper For Multilingual ASR with 🤗Transformers](https://huggingface.co/blog/fine-tune-whisper)
|
63 |
- [Speech Synthesis, Recognition, and More With SpeechT5](https://huggingface.co/blog/speecht5)
|
64 |
+
- [Optimizing a Text-To-Speech model using 🤗 Transformers](https://huggingface.co/blog/optimizing-bark)
|
65 |
+
-
|
packages/tasks/src/tasks/zero-shot-object-detection/about.md
CHANGED
@@ -1,5 +1,7 @@
|
|
1 |
## Use Cases
|
2 |
|
|
|
|
|
3 |
### Object Search
|
4 |
|
5 |
Zero-shot object detection models can be used in image search. Smartphones, for example, use zero-shot object detection models to detect entities (such as specific places or objects) and allow the user to search for the entity on the internet.
|
@@ -8,6 +10,10 @@ Zero-shot object detection models can be used in image search. Smartphones, for
|
|
8 |
|
9 |
Zero-shot object detection models are used to count instances of objects in a given image. This can include counting the objects in warehouses or stores or the number of visitors in a store. They are also used to manage crowds at events to prevent disasters.
|
10 |
|
|
|
|
|
|
|
|
|
11 |
## Inference
|
12 |
|
13 |
You can infer with zero-shot object detection models through the `zero-shot-object-detection` pipeline. When calling the pipeline, you just need to specify a path or HTTP link to an image and the candidate labels.
|
|
|
1 |
## Use Cases
|
2 |
|
3 |
+
Zero-shot object detection models can be used in any object detection application where the detection involves text queries for objects of interest.
|
4 |
+
|
5 |
### Object Search
|
6 |
|
7 |
Zero-shot object detection models can be used in image search. Smartphones, for example, use zero-shot object detection models to detect entities (such as specific places or objects) and allow the user to search for the entity on the internet.
|
|
|
10 |
|
11 |
Zero-shot object detection models are used to count instances of objects in a given image. This can include counting the objects in warehouses or stores or the number of visitors in a store. They are also used to manage crowds at events to prevent disasters.
|
12 |
|
13 |
+
### Object Tracking
|
14 |
+
|
15 |
+
Zero-shot object detectors can track objects in videos.
|
16 |
+
|
17 |
## Inference
|
18 |
|
19 |
You can infer with zero-shot object detection models through the `zero-shot-object-detection` pipeline. When calling the pipeline, you just need to specify a path or HTTP link to an image and the candidate labels.
|
packages/tasks/tsconfig.json
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
"compilerOptions": {
|
3 |
"allowSyntheticDefaultImports": true,
|
4 |
"lib": ["ES2022", "DOM"],
|
5 |
-
"module": "
|
6 |
"moduleResolution": "node",
|
7 |
"target": "ES2022",
|
8 |
"forceConsistentCasingInFileNames": true,
|
@@ -13,6 +13,6 @@
|
|
13 |
"noImplicitOverride": true,
|
14 |
"outDir": "./dist"
|
15 |
},
|
16 |
-
"include": ["src"
|
17 |
"exclude": ["dist"]
|
18 |
}
|
|
|
2 |
"compilerOptions": {
|
3 |
"allowSyntheticDefaultImports": true,
|
4 |
"lib": ["ES2022", "DOM"],
|
5 |
+
"module": "CommonJS",
|
6 |
"moduleResolution": "node",
|
7 |
"target": "ES2022",
|
8 |
"forceConsistentCasingInFileNames": true,
|
|
|
13 |
"noImplicitOverride": true,
|
14 |
"outDir": "./dist"
|
15 |
},
|
16 |
+
"include": ["src"],
|
17 |
"exclude": ["dist"]
|
18 |
}
|