Downloads · 30 days
85
16% of all-time downloads
philschmid/codegen-6B-mono-sharded-bnb
codegen-6B-mono-sharded-bnb is a text generation model from philschmid. Use it when you need the model to write or continue text. It is set up for transformers. The card lists the license as bsd-3-clause.
This repository implements a custom pipeline task for text-generation for 🤗 Inference Endpoints for LLM inference using bitsandbytes quantization. The code for the customized pipeline is in the pipeline.py.
Downloads · 30 days
85
16% of all-time downloads
All-time downloads
523
Public
Repo size
28.5 GB
Likes
2
Public
Click a slice to open those files.
.bin14.3 GB · 100%
From the Hugging Face model README
This repository implements a custom pipeline task for text-generation for 🤗 Inference Endpoints for LLM inference using bitsandbytes quantization. The code for the customized pipeline is in the pipeline.py.
There is also a notebook included.
{
"inputs": "# load distilbert model and initialize text-classification pipeline\nmodel_id = 'distil",
"parameters": {
"top_k": 100,
"max_length": 64,
"early_stopping": true,
"do_sample": true,
"eos_token_id": 50256,
}
}
below is an example on how to run a request using Python and requests.
import json
from typing import List
import requests as r
import base64
ENDPOINT_URL = ""
HF_TOKEN = ""
parameters={
"top_k": 100,
"max_length": 64,
"early_stopping": True,
"do_sample": True,
"eos_token_id": 50256,
}
def predict(code_snippet:str=None):
payload = {"inputs": code_snippet,"parameters": parameters}
response = r.post(
ENDPOINT_URL, headers={"Authorization": f"Bearer {HF_TOKEN}"}, json=payload
)
return response.json()
prediction = predict(
code_snippet="# load distilbert model and initialize text-classification pipeline\nmodel_id = 'distil"
)
expected output
{'generated_text': "# load distilbert model and initialize text-classification pipeline\nmodel_id = 'distilbert-base-uncased'\nmodel_url = 'https://tfhub.dev/tensorflow/small_bert/1'\n\nmodel_dir = './distilBERT'"}