Créer une session d’importation de jeu de données
curl --request POST \
--url https://distillation.training.wandb.ai/v1/tasks/{alias}/dataset-imports \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"idempotency_key": "<string>",
"name": "<string>",
"file": {
"name": "<string>",
"size_bytes": 123
},
"split_policy": {
"mode": "preserve"
},
"duplicate_policy": {
"split_overlap": "reject"
}
}
'import requests
url = "https://distillation.training.wandb.ai/v1/tasks/{alias}/dataset-imports"
payload = {
"idempotency_key": "<string>",
"name": "<string>",
"file": {
"name": "<string>",
"size_bytes": 123
},
"split_policy": { "mode": "preserve" },
"duplicate_policy": { "split_overlap": "reject" }
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
idempotency_key: '<string>',
name: '<string>',
file: {name: '<string>', size_bytes: 123},
split_policy: {mode: 'preserve'},
duplicate_policy: {split_overlap: 'reject'}
})
};
fetch('https://distillation.training.wandb.ai/v1/tasks/{alias}/dataset-imports', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://distillation.training.wandb.ai/v1/tasks/{alias}/dataset-imports",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'idempotency_key' => '<string>',
'name' => '<string>',
'file' => [
'name' => '<string>',
'size_bytes' => 123
],
'split_policy' => [
'mode' => 'preserve'
],
'duplicate_policy' => [
'split_overlap' => 'reject'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://distillation.training.wandb.ai/v1/tasks/{alias}/dataset-imports"
payload := strings.NewReader("{\n \"idempotency_key\": \"<string>\",\n \"name\": \"<string>\",\n \"file\": {\n \"name\": \"<string>\",\n \"size_bytes\": 123\n },\n \"split_policy\": {\n \"mode\": \"preserve\"\n },\n \"duplicate_policy\": {\n \"split_overlap\": \"reject\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://distillation.training.wandb.ai/v1/tasks/{alias}/dataset-imports")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"idempotency_key\": \"<string>\",\n \"name\": \"<string>\",\n \"file\": {\n \"name\": \"<string>\",\n \"size_bytes\": 123\n },\n \"split_policy\": {\n \"mode\": \"preserve\"\n },\n \"duplicate_policy\": {\n \"split_overlap\": \"reject\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://distillation.training.wandb.ai/v1/tasks/{alias}/dataset-imports")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"idempotency_key\": \"<string>\",\n \"name\": \"<string>\",\n \"file\": {\n \"name\": \"<string>\",\n \"size_bytes\": 123\n },\n \"split_policy\": {\n \"mode\": \"preserve\"\n },\n \"duplicate_policy\": {\n \"split_overlap\": \"reject\"\n }\n}"
response = http.request(request)
puts response.read_body{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"task_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"dataset_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"split_policy": {},
"duplicate_policy": {},
"state": "uploading",
"total_bytes": 2,
"counters": {
"staged_rows": 1,
"rejected_rows": 1,
"validation_errors": 1,
"errors_by_code": {},
"rows_by_split": {}
},
"error": "<string>",
"expires_at": "2023-11-07T05:31:56Z",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"file": {
"name": "<string>",
"size_bytes": 2,
"part_size_bytes": 2,
"part_count": 2,
"state": "pending",
"uploaded_bytes": 1,
"parts": [
{
"part_number": 2,
"size_bytes": 1,
"etag": "<string>"
}
]
},
"validation": {
"validation_state": "pending",
"validated_bytes": 1,
"validated_lines": 1,
"validated_rows": 1,
"raw_sha256": "<string>",
"error_count": 1,
"errors_truncated": true,
"errors": [
{
"physical_line": 2,
"source_byte_offset": 1,
"code": "<string>",
"message": "<string>"
}
]
}
}{
"error": {
"message": "Task 'missing' not found in entity 'your-team'",
"type": "not_found"
}
}Créer une session d’importation de dataset
POST
/
tasks
/
{alias}
/
dataset-imports
Créer une session d’importation de jeu de données
curl --request POST \
--url https://distillation.training.wandb.ai/v1/tasks/{alias}/dataset-imports \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"idempotency_key": "<string>",
"name": "<string>",
"file": {
"name": "<string>",
"size_bytes": 123
},
"split_policy": {
"mode": "preserve"
},
"duplicate_policy": {
"split_overlap": "reject"
}
}
'import requests
url = "https://distillation.training.wandb.ai/v1/tasks/{alias}/dataset-imports"
payload = {
"idempotency_key": "<string>",
"name": "<string>",
"file": {
"name": "<string>",
"size_bytes": 123
},
"split_policy": { "mode": "preserve" },
"duplicate_policy": { "split_overlap": "reject" }
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
idempotency_key: '<string>',
name: '<string>',
file: {name: '<string>', size_bytes: 123},
split_policy: {mode: 'preserve'},
duplicate_policy: {split_overlap: 'reject'}
})
};
fetch('https://distillation.training.wandb.ai/v1/tasks/{alias}/dataset-imports', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://distillation.training.wandb.ai/v1/tasks/{alias}/dataset-imports",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'idempotency_key' => '<string>',
'name' => '<string>',
'file' => [
'name' => '<string>',
'size_bytes' => 123
],
'split_policy' => [
'mode' => 'preserve'
],
'duplicate_policy' => [
'split_overlap' => 'reject'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://distillation.training.wandb.ai/v1/tasks/{alias}/dataset-imports"
payload := strings.NewReader("{\n \"idempotency_key\": \"<string>\",\n \"name\": \"<string>\",\n \"file\": {\n \"name\": \"<string>\",\n \"size_bytes\": 123\n },\n \"split_policy\": {\n \"mode\": \"preserve\"\n },\n \"duplicate_policy\": {\n \"split_overlap\": \"reject\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://distillation.training.wandb.ai/v1/tasks/{alias}/dataset-imports")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"idempotency_key\": \"<string>\",\n \"name\": \"<string>\",\n \"file\": {\n \"name\": \"<string>\",\n \"size_bytes\": 123\n },\n \"split_policy\": {\n \"mode\": \"preserve\"\n },\n \"duplicate_policy\": {\n \"split_overlap\": \"reject\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://distillation.training.wandb.ai/v1/tasks/{alias}/dataset-imports")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"idempotency_key\": \"<string>\",\n \"name\": \"<string>\",\n \"file\": {\n \"name\": \"<string>\",\n \"size_bytes\": 123\n },\n \"split_policy\": {\n \"mode\": \"preserve\"\n },\n \"duplicate_policy\": {\n \"split_overlap\": \"reject\"\n }\n}"
response = http.request(request)
puts response.read_body{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"task_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"dataset_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"split_policy": {},
"duplicate_policy": {},
"state": "uploading",
"total_bytes": 2,
"counters": {
"staged_rows": 1,
"rejected_rows": 1,
"validation_errors": 1,
"errors_by_code": {},
"rows_by_split": {}
},
"error": "<string>",
"expires_at": "2023-11-07T05:31:56Z",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"file": {
"name": "<string>",
"size_bytes": 2,
"part_size_bytes": 2,
"part_count": 2,
"state": "pending",
"uploaded_bytes": 1,
"parts": [
{
"part_number": 2,
"size_bytes": 1,
"etag": "<string>"
}
]
},
"validation": {
"validation_state": "pending",
"validated_bytes": 1,
"validated_lines": 1,
"validated_rows": 1,
"raw_sha256": "<string>",
"error_count": 1,
"errors_truncated": true,
"errors": [
{
"physical_line": 2,
"source_byte_offset": 1,
"code": "<string>",
"message": "<string>"
}
]
}
}{
"error": {
"message": "Task 'missing' not found in entity 'your-team'",
"type": "not_found"
}
}Autorisations
Une clé API W&B.
En-têtes
entity personnel ou d’équipe accessible. Omettez ce champ pour utiliser l’entity par défaut de l’utilisateur authentifié.
Paramètres de chemin
Pattern:
^[a-z0-9-]{1,64}$Corps
application/json
Réponse
Session persistante de téléversement en plusieurs parties.
ID du jeu de données de destination, attribué au début de la création du jeu de données. Attendez que le jeu de données soit à l’état ready avant de l’utiliser. Null avant la création ou après la suppression du jeu de données.
Politique de partitionnement acceptée lors de la création de l’importation.
Politique de gestion des doublons acceptée lors de la création de l’importation.
Options disponibles:
uploading, queued, validating, auditing, committing, ready, failed, cancelled, expired Plage requise:
x >= 1Totaux de validation lorsqu’ils sont disponibles ; sinon null.
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Dernière modification le 30 septembre 2026
Cette page vous a-t-elle été utile ?