# İşler

Hub'daki İşlerinizi yönetmek için kullanılan yöntemlerin referansı için [HfApi](/docs/huggingface_hub/v2.4.0/tr/package_reference/hf_api#huggingface_hub.HfApi) dokümantasyon sayfasını kontrol edin.

- İş Çalıştır: [run_job()](/docs/huggingface_hub/v2.4.0/tr/package_reference/hf_api#huggingface_hub.HfApi.run_job)
- Günlükleri getir: [fetch_job_logs()](/docs/huggingface_hub/v2.4.0/tr/package_reference/hf_api#huggingface_hub.HfApi.fetch_job_logs)
- Metrikleri getir: [fetch_job_metrics()](/docs/huggingface_hub/v2.4.0/tr/package_reference/hf_api#huggingface_hub.HfApi.fetch_job_metrics)
- İş Denetimi: [inspect_job()](/docs/huggingface_hub/v2.4.0/tr/package_reference/hf_api#huggingface_hub.HfApi.inspect_job)
- İş(ler)in bitmesini bekleyin: [wait_for_job()](/docs/huggingface_hub/v2.4.0/tr/package_reference/hf_api#huggingface_hub.HfApi.wait_for_job)
- İşleri Listele: [list_jobs()](/docs/huggingface_hub/v2.4.0/tr/package_reference/hf_api#huggingface_hub.HfApi.list_jobs)
- İşlem İptali: [cancel_job()](/docs/huggingface_hub/v2.4.0/tr/package_reference/hf_api#huggingface_hub.HfApi.cancel_job)
- UV İşini Çalıştır: [run_uv_job()](/docs/huggingface_hub/v2.4.0/tr/package_reference/hf_api#huggingface_hub.HfApi.run_uv_job)
- Bir Job'da bağlamak için yerel bir dizini senkronize edin: [sync_job_volume()](/docs/huggingface_hub/v2.4.0/tr/package_reference/hf_api#huggingface_hub.HfApi.sync_job_volume)

## Veri yapıları

### JobInfo[[huggingface_hub.JobInfo]]

#### huggingface_hub.JobInfo[[huggingface_hub.JobInfo]]

```python
huggingface_hub.JobInfo(**kwargs)
```

[Kaynak](https://github.com/huggingface/huggingface_hub/blob/v2.4.0/src/huggingface_hub/_jobs_api.py#L186)

**Parametreler:**

id (`str`) : İş kimliği.

created_at (`datetime` veya `None`) : Job oluşturulduğunda.

started_at (`datetime` veya `None`) : Job'un çalışmaya başladığı zaman. Job hâlâ zamanlanırken None.

finished_at (`datetime` veya `None`) : İşin bittiği zaman. İş hâlâ zamanlanıyor veya çalışıyorsa None.

docker_image (`str` veya `None`) : Job için Docker Hub'dan kullanılan Docker görüntüsü. Bunun yerine space_id mevcut ise None olabilir.

space_id (`str` veya `None`) : Job için kullanılan Hugging Face Spaces Docker görüntüsü. Bunun yerine docker_image mevcut ise None olabilir.

command (`list[str]` veya `None`) : İşin komutu, örn. `["python", "-c", "print('hello world')"]`

arguments (`list[str]` veya `None`) : Komuta aktarılan argümanlar

environment (`dict[str]` veya `None`) : Job'un ortam değişkenlerini bir sözlük olarak belirtir.

secrets (`dict[str]` veya `None`) : Job'un gizli ortam değişkenleri (şifreli).

flavor (`str` veya `None`) : Donanım için tür. Olası değerler için `JobHardware`'a bakın. Örn. `"cpu-basic"`.

labels (`dict[str, str]` veya `None`) : İşe eklenecek etiketler (anahtar-değer çiftleri).

volumes (`list[Volume]` veya `None`) : İş konteynerine bağlanan hacimler (varlıklar, modeller, veri kümeleri, uzaylar).

status : (`JobStatus` veya `None`): İşin durumu, örn. `JobStatus(stage="RUNNING", message=None)` Olası aşama değerleri için [JobStage](/docs/huggingface_hub/v2.4.0/tr/package_reference/jobs#huggingface_hub.JobStage)'e bakın.

durations (`JobDurations` veya `None`) : Job'un zamanlama dökümü. SCHEDULING dahil olmak üzere tüm job durumları için mevcuttur.

owner : (`JobOwner` veya `None`): İşin sahibi, örn. `JobOwner(id="5e9ecfc04957053f60648a3e", name="lhoestq", type="user")`

initiator (`JobInitiator` veya `None`) : Job'u ne tetikledi, örneğin cron ile tetiklenen bir çalıştırma için `JobInitiator(type="scheduled-job", id="...")`.

expose_urls (`list[str]` veya `None`) : Job'un açık portlarına erişilebilen herkese açık URL'ler (her açık port için bir tane), örn. `["https://687fb701029421ae5549d998--8000.hf.jobs"]`. Hiçbir port açık değilse `None`. Bir URL'ye erişmek, port herkese açık olmadıkça, Job'un namespace'ine okuma erişimi olan bir HF token gerektirir.

ssh_url (`str` veya `None`) : İşin SSH uç noktası, örn. `"ssh://687fb701029421ae5549d998@ssh.hf.jobs"`. Yalnızca İş `ssh=True` ile başlatıldığında mevcuttur. Bağlanmak için İşin ad alanına yazma erişimi ve Hub'da (https://huggingface.co/settings/keys) kayıtlı bir SSH anahtar gerektirir.

network (`JobNetwork` veya `None`) : Job'un katıldığı ağ ve iddia ettiği takma adlar, örn. `JobNetwork(group="train", aliases=["master"])`. Job `network_group=` olmadan başlatıldığında `None`.

retry (`int` veya `None`) : Job için yapılandırılan yeniden deneme sayısı (`attempts - 1`).

expose (`list[int]` veya `None`) : Jobs proxy üzerinden açılan tüm portlar, herkese açık olanlar dahil.

expose_public (`list[int]` veya `None`) : Kimlik doğrulama olmadan erişilebilir olan açık portlar.

Bir Job hakkında bilgi içerir.

Örnek:

```python
>>> from huggingface_hub import run_job
>>> job = run_job(
...     image="python:3.12",
...     command=["python", "-c", "print('Hello from the cloud!')"]
... )
>>> job
JobInfo(id='687fb701029421ae5549d998', created_at=datetime.datetime(2025, 7, 22, 16, 6, 25, 79000, tzinfo=datetime.timezone.utc), started_at=datetime.datetime(2025, 7, 22, 16, 6, 31, 79000, tzinfo=datetime.timezone.utc), finished_at=None, docker_image='python:3.12', space_id=None, command=['python', '-c', "print('Hello from the cloud!')"], arguments=[], environment={}, secrets={}, flavor='cpu-basic', labels=None, status=JobStatus(stage='RUNNING', message=None), durations=JobDurations(scheduling_secs=6, running_secs=2, total_secs=8), owner=JobOwner(id='5e9ecfc04957053f60648a3e', name='lhoestq', type='user'), initiator=JobInitiator(type='user', id='5e9ecfc04957053f60648a3e', name='lhoestq'), endpoint='https://huggingface.co', url='https://huggingface.co/jobs/lhoestq/687fb701029421ae5549d998')
>>> job.id
'687fb701029421ae5549d998'
>>> job.url
'https://huggingface.co/jobs/lhoestq/687fb701029421ae5549d998'
>>> job.status.stage
'RUNNING'
```

### JobOwner[[huggingface_hub.JobOwner]]

#### huggingface_hub.JobOwner[[huggingface_hub.JobOwner]]

```python
huggingface_hub.JobOwner(id: str, name: str, type: str)
```

[Kaynak](https://github.com/huggingface/huggingface_hub/blob/v2.4.0/src/huggingface_hub/_jobs_api.py#L116)

### JobNetwork[[huggingface_hub.JobNetwork]]

#### huggingface_hub.JobNetwork[[huggingface_hub.JobNetwork]]

```python
huggingface_hub.JobNetwork(**kwargs)
```

[Kaynak](https://github.com/huggingface/huggingface_hub/blob/v2.4.0/src/huggingface_hub/_jobs_api.py#L123)

**Parametreler:**

group (`str`) : `network_group=` parametresine geçirilen ağ grubunun adı.

aliases (`list[str]`) : Grubun, `network_aliases=` parametresine geçirildiği gibi, Job'ların iddia ettiği takma adları. Hiçbiri yoksa boş.

Ağ grubuna bir İş katıldı.

### JobStage[[huggingface_hub.JobStage]]

#### huggingface_hub.JobStage[[huggingface_hub.JobStage]]

```python
huggingface_hub.JobStage(value, names = None, module = None, qualname = None, type = None, start = 1)
```

[Kaynak](https://github.com/huggingface/huggingface_hub/blob/v2.4.0/src/huggingface_hub/_jobs_api.py#L71)

Hub'daki bir Job'ın olası aşamalarının listesi.

Value bir dizeyle karşılaştırılabilir:
```py
assert JobStage.COMPLETED == "COMPLETED"
```

Olası değerler şunlardır: `COMPLETED`, `CANCELED`, `ERROR`, `DELETED`, `SCHEDULING`, `RUNNING`. https://github.com/huggingface/moon-landing/blob/main/server/job_types/JobInfo.ts#L61 adresinden alınmıştır (özel url).

### JobStatus[[huggingface_hub.JobStatus]]

#### huggingface_hub.JobStatus[[huggingface_hub.JobStatus]]

```python
huggingface_hub.JobStatus(stage: JobStage, message: str | None, expose_urls: list[str] | None, ssh_url: str | None)
```

[Kaynak](https://github.com/huggingface/huggingface_hub/blob/v2.4.0/src/huggingface_hub/_jobs_api.py#L108)

### Hacim[[huggingface_hub.Volume]]

#### huggingface_hub.Volume[[huggingface_hub.Volume]]

```python
huggingface_hub.Volume(**kwargs)
```

[Kaynak](https://github.com/huggingface/huggingface_hub/blob/v2.4.0/src/huggingface_hub/_space_api.py#L128)

**Parametreler:**

type (`str`) : Hacim türü: `"bucket"`, `"model"`, `"dataset"` veya `"space"`.

source (`str`) : Kaynak tanımlayıcı, örn. `"username/my-bucket"` veya `"username/my-model"`.

mount_path (`str`) : Konteyner içindeki bağlama yolu, örn. `"/data"`. `/` ile başlamalıdır.

revision (`str` veya `None`) : Git revizyonu (yalnızca depolar için, varsayılan `"main"`).

read_only (`bool` veya `None`) : Salt okunur montaj. Depolar için `True` olarak zorunlu tutulur, variller için varsayılan değeri `False`'dir.

path (`str` veya `None`) : Mount edilecek bucket/repo içindeki alt klasör öneki, örneğin `"path/to/dir"`.

Bir Space veya Job konteynerine bağlanacak bir hacmi açıklar.

#### to_dict[[huggingface_hub.Volume.to_dict]]

```python
to_dict()
```

[Kaynak](https://github.com/huggingface/huggingface_hub/blob/v2.4.0/src/huggingface_hub/_space_api.py#L164)

Hub API tarafından beklenen JSON yüklemesine (payload) serialize edin.

#### to_uri[[huggingface_hub.Volume.to_uri]]

```python
to_uri()
```

[Kaynak](https://github.com/huggingface/huggingface_hub/blob/v2.4.0/src/huggingface_hub/_space_api.py#L179)

Hacmi, CLI tarafından beklenen formatta bir HF mount URI olarak döndürün.

