Skip to content

Commit 962b1ef

Browse files
osansevieromishig25gary149julien-c
authored
Add first robotic tag (#349)
* Update Types.ts * Add icon and fix docs * Fix lots of things * style * Update js/src/lib/components/Icons/IconRobotics.svelte Co-authored-by: Mishig <[email protected]> * icon update * Formatting Co-authored-by: Mishig <[email protected]> Co-authored-by: Victor Mustar <[email protected]> Co-authored-by: Julien Chaumond <[email protected]>
1 parent 2c73504 commit 962b1ef

File tree

6 files changed

+53
-9
lines changed

6 files changed

+53
-9
lines changed

docs/hub/models-tasks.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -71,13 +71,14 @@ The Hub allows users to filter models by a given task. To do this, you need to a
7171

7272
In [interfaces/Types.ts](https://github.com/huggingface/hub-docs/blob/main/js/src/lib/interfaces/Types.ts), you need to do a couple of things
7373

74-
* Add the type to `PipelineType`. Note that pipeline types are sorted into different categories (NLP, Audio, Computer Vision, and others).
75-
* Specify the task color in `PIPELINE_COLOR`.
76-
* Specify the display order in `PIPELINE_TAGS_DISPLAY_ORDER`.
74+
* Add the type to `PIPELINE_DATA`. Note that pipeline types are sorted into different categories (NLP, Audio, Computer Vision, and others).
75+
* Specify the display order in `PIPELINE_TAGS_DISPLAY_ORDER`. It also needs minor changes in the following files:
76+
1. [tasks/src/const.ts](https://github.com/huggingface/hub-docs/blob/main/tasks/src/const.ts)
77+
2. [tasks/src/tasksData.ts](https://github.com/huggingface/hub-docs/blob/main/tasks/src/tasksData.ts)
7778

7879
2. Choose an icon
7980

80-
You can add an icon in the [lib/Icons](https://github.com/huggingface/hub-docs/tree/main/js/src/lib/Icons) directory. We usually choose carbon icons from https://icones.js.org/collection/carbon.
81+
You can add an icon in the [lib/Icons](https://github.com/huggingface/hub-docs/tree/main/js/src/lib/components/Icons) directory. We usually choose carbon icons from https://icones.js.org/collection/carbon. Also add the icon to [ModelPipelineIcon](https://github.com/huggingface/hub-docs/blob/main/tasks/src/lib/components/ModelPipelineIcon/ModelPipelineIcon.svelte).
8182

8283

8384
### Widget
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<script lang="ts">
2+
export let classNames = "";
3+
</script>
4+
5+
<svg
6+
class={classNames}
7+
xmlns="http://www.w3.org/2000/svg"
8+
xmlns:xlink="http://www.w3.org/1999/xlink"
9+
aria-hidden="true"
10+
fill="currentColor"
11+
focusable="false"
12+
role="img"
13+
width="1em"
14+
height="1em"
15+
preserveAspectRatio="xMidYMid meet"
16+
viewBox="0 0 12 12"
17+
>
18+
<path
19+
d="M2.41562 9.48284H4.48563L1.79462 5.04284C1.61912 4.76855 1.51562 4.46427 1.51562 4.1257C1.51603 3.70884 1.67594 3.30641 1.96543 2.99375C2.25491 2.68109 2.65413 2.47963 3.08834 2.42708C3.52255 2.37454 3.96198 2.47451 4.32437 2.70829C4.68676 2.94206 4.94727 3.29361 5.05712 3.69713H6.91562V2.6257C6.91562 2.15427 7.32062 1.76855 7.81562 1.76855V2.87855L8.53112 2.19713H10.5156V3.05427H8.90012L7.81562 4.08713V4.16427L8.90012 5.19713H10.5156V6.05427H8.53112L7.81562 5.37284V6.48284C7.57693 6.48284 7.34801 6.39253 7.17923 6.23179C7.01045 6.07104 6.91562 5.85303 6.91562 5.6257V4.55427H5.05712C5.01212 4.72141 4.94012 4.87998 4.85012 5.0257L7.55012 9.48284H9.61562C9.85432 9.48284 10.0832 9.57315 10.252 9.73389C10.4208 9.89464 10.5156 10.1127 10.5156 10.34H1.51562C1.51562 9.86855 1.92062 9.48284 2.41562 9.48284ZM4.17512 5.6257C3.92312 5.76284 3.63062 5.83998 3.31562 5.83998L5.52512 9.48284H6.51063L4.17512 5.6257ZM3.31562 3.26855C3.07693 3.26855 2.84801 3.35886 2.67923 3.51961C2.51045 3.68035 2.41562 3.89837 2.41562 4.1257C2.41562 4.60141 2.81612 4.98284 3.31562 4.98284C3.81512 4.98284 4.21562 4.60141 4.21562 4.1257C4.21562 3.89837 4.1208 3.68035 3.95202 3.51961C3.78324 3.35886 3.55432 3.26855 3.31562 3.26855Z"
20+
fill="currentColor"
21+
/>
22+
</svg>

js/src/lib/components/ModelPipelineIcon/ModelPipelineIcon.svelte

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
import IconVoiceActivityDetection from "../Icons/IconVoiceActivityDetection.svelte";
2929
import IconZeroShotClassification from "../Icons/IconZeroShotClassification.svelte";
3030
import IconReinforcementLearning from "../Icons/IconReinforcementLearning.svelte";
31+
import IconRobotics from "../Icons/IconRobotics.svelte";
3132
import IconImageToImage from "../Icons/IconImageToImage.svelte";
3233
import IconUnconditionalImageGeneration from "../Icons/IconUnconditionalImageGeneration.svelte";
3334
import IconDocumentQuestionAnswering from "../Icons/IconDocumentQuestionAnswering.svelte";
@@ -66,6 +67,7 @@
6667
"image-to-image": IconImageToImage,
6768
"unconditional-image-generation": IconUnconditionalImageGeneration,
6869
"reinforcement-learning": IconReinforcementLearning,
70+
robotics: IconRobotics,
6971
"tabular-classification": IconTabularClassification,
7072
"tabular-regression": IconTabularRegression,
7173
"document-question-answering": IconDocumentQuestionAnswering,

js/src/lib/interfaces/Types.ts

Lines changed: 22 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -448,6 +448,22 @@ export const PIPELINE_DATA = ensureRecordOfPipelines({
448448
color: "red",
449449
hideInDatasets: true,
450450
},
451+
"robotics": {
452+
name: "Robotics",
453+
modality: "rl",
454+
subtasks: [
455+
{
456+
type: "grasping",
457+
name: "Grasping",
458+
},
459+
{
460+
type: "task-planning",
461+
name: "Task Planning",
462+
},
463+
],
464+
color: "blue",
465+
hideInDatasets: true,
466+
},
451467
"tabular-classification": {
452468
name: "Tabular Classification",
453469
modality: "tabular",
@@ -573,14 +589,14 @@ export const PIPELINE_DATA = ensureRecordOfPipelines({
573589
name: "Document Question Answering",
574590
},
575591
],
576-
modality: "multimodal",
577-
color: "blue",
592+
modality: "multimodal",
593+
color: "blue",
578594
hideInDatasets: true,
579595
},
580596
"zero-shot-image-classification": {
581-
name: "Zero-Shot Image Classification",
582-
modality: "cv",
583-
color: "yellow",
597+
name: "Zero-Shot Image Classification",
598+
modality: "cv",
599+
color: "yellow",
584600
},
585601
"other": {
586602
name: "Other",
@@ -632,6 +648,7 @@ export const PIPELINE_TAGS_DISPLAY_ORDER: Array<PipelineType> = [
632648
"visual-question-answering",
633649
"image-to-text",
634650
"reinforcement-learning",
651+
"robotics",
635652
"voice-activity-detection",
636653
"time-series-forecasting",
637654
"document-question-answering",

tasks/src/const.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ export const TASKS_MODEL_LIBRARIES: Record<PipelineType, Array<keyof typeof Mode
2020
"object-detection": ["transformers"],
2121
"other": [],
2222
"question-answering": ["adapter-transformers", "allennlp", "transformers"],
23+
"robotics": [],
2324
"reinforcement-learning": ["transformers", "stable-baselines3", "ml-agents"],
2425
"sentence-similarity": ["sentence-transformers", "spacy"],
2526
"summarization": ["transformers"],

tasks/src/tasksData.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ export const TASKS_DATA: Record<PipelineType, TaskData | undefined> = {
4141
"other": undefined,
4242
"question-answering": getData("question-answering", questionAnswering),
4343
"reinforcement-learning": getData("reinforcement-learning"),
44+
"robotics": getData("robotics"),
4445
"sentence-similarity": getData("sentence-similarity", sentenceSimilarity),
4546
"summarization": getData("summarization", summarization),
4647
"table-question-answering": getData("table-question-answering"),

0 commit comments

Comments
 (0)