Run this model with HF Jobs

Run Sweety0403/Llama3_de1 on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.

Paste one of these prompts into your coding agent:

Fine-tune on my dataset

Use HF Jobs to fine-tune https://huggingface.co/Sweety0403/Llama3_de1. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.

Run batch inference

Use HF Jobs to run batch inference with https://huggingface.co/Sweety0403/Llama3_de1 on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.
File size: 1,389 Bytes
8bd2a62
 
 
 
 
 
 
 
9d8ee7f
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
8bd2a62
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "96dcdfb2-0599-4e9a-a415-97f32edd0c5b",
   "metadata": {},
   "outputs": [],
   "source": [
    "from huggingface_hub import login\n",
    "import os\n",
    "from transformers import pipeline\n",
    "\n",
    "class EndpointHandler:\n",
    "    def __init__(self, path=\"\"):\n",
    "        token = os.getenv(\"HUGGINGFACE_HUB_TOKEN\")\n",
    "        if not token:\n",
    "            raise EnvironmentError(\"Missing HUGGINGFACE_HUB_TOKEN in environment.\")\n",
    "        login(token=token)\n",
    "\n",
    "        self.pipeline = pipeline(\n",
    "            task=\"text-generation\",\n",
    "            model=\"meta-llama/Llama-3.2-1B\",\n",
    "            device=0\n",
    "        )\n",
    "\n",
    "    def __call__(self, data):\n",
    "        inputs = data.get(\"inputs\", \"\")\n",
    "        return self.pipeline(inputs)\n"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3 (ipykernel)",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.10.13"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}