Text Generation
Transformers
Safetensors
starcoder2
code
Eval Results (legacy)
text-generation-inference
4-bit precision
awq
Instructions to use TechxGenus/starcoder2-7b-AWQ with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use TechxGenus/starcoder2-7b-AWQ with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="TechxGenus/starcoder2-7b-AWQ")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("TechxGenus/starcoder2-7b-AWQ") model = AutoModelForCausalLM.from_pretrained("TechxGenus/starcoder2-7b-AWQ") - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use TechxGenus/starcoder2-7b-AWQ with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "TechxGenus/starcoder2-7b-AWQ" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "TechxGenus/starcoder2-7b-AWQ", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/TechxGenus/starcoder2-7b-AWQ
- SGLang
How to use TechxGenus/starcoder2-7b-AWQ with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "TechxGenus/starcoder2-7b-AWQ" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "TechxGenus/starcoder2-7b-AWQ", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "TechxGenus/starcoder2-7b-AWQ" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "TechxGenus/starcoder2-7b-AWQ", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use TechxGenus/starcoder2-7b-AWQ with Docker Model Runner:
docker model run hf.co/TechxGenus/starcoder2-7b-AWQ
Bad generated text using tgi
#1
by erfanium - opened
This is how i deployed the tgi with this model:
version: "3.8"
services:
hftgi:
container_name: hftgi
restart: always
image: ghcr.io/huggingface/text-generation-inference:2.0.1
ports:
- 8080:80
command: --model-id TechxGenus/starcoder2-7b-AWQ --quantize=awq --max-best-of=1 --max-stop-sequences=100 --max-input-length=4096 --max-total-tokens=4224
volumes:
- "./data:/data"
deploy:
resources:
reservations:
devices:
- driver: nvidia
count: 1
capabilities: [gpu]
when I call POST /generate with request body:
{
"inputs": "def hello_world:",
"parameters": {
"best_of": 1,
"frequency_penalty": 0.1,
"max_new_tokens": 120,
"repetition_penalty": 1.03,
"return_full_text": true,
"stop": [
"\n"
],
"temperature": 0.1
}
}
Here is the generated text:
def hello_world:ustenia��百lage長长度ination传递 Commons首GOOGLE��artaForwardedobotDispatchcachingCompareooารvolvedaut藏tributesturesENU passagedoporiaMetaistan�ulyazardProvidedи autwho山irtualership备 dopster�ensure moriresuls forever��StripooooaraIMEN NOIobiMatcherJECTowane售nodisDispositionautoloadFxArtuí strianuorp Immutable sampleHUDRIDUST clsDI culpa得uth wait�Waittendeistant径Ly! стр successfullyка成 fanIGN�Compression din oncegetHeadergsIS stubNid�Formattinginated永堠 'idlIMPLEMENTArgumentError unique
See https://github.com/huggingface/transformers/issues/30225.
This bug has not been fixed in the main branch yet. You can consider using vllm for deployment.