Instructions to use rifkat/GPTuz with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use rifkat/GPTuz with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="rifkat/GPTuz")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("rifkat/GPTuz") model = AutoModelForCausalLM.from_pretrained("rifkat/GPTuz") - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use rifkat/GPTuz with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "rifkat/GPTuz" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "rifkat/GPTuz", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/rifkat/GPTuz
- SGLang
How to use rifkat/GPTuz 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 "rifkat/GPTuz" \ --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": "rifkat/GPTuz", "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 "rifkat/GPTuz" \ --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": "rifkat/GPTuz", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use rifkat/GPTuz with Docker Model Runner:
docker model run hf.co/rifkat/GPTuz
GPTuzmodel.
GPTuz GPT-2 kichik modelga asoslangan Uzbek tili uchun state-of-the-art til modeli.
Bu model GPU NVIDIA V100 32GB va 0.53 GB malumotlarni kun.uz dan foydalanilgan holda Transfer Learning va Fine-tuning texnikasi asosida 1 kundan ziyod vaqt davomida o'qitilgan.
Qanday foydaniladi
from transformers import AutoTokenizer, AutoModelWithLMHead
import torch
tokenizer = AutoTokenizer.from_pretrained("rifkat/GPTuz")
model = AutoModelWithLMHead.from_pretrained("rifkat/GPTuz")
tokenizer.model_max_length=1024
Bitta so'z yaratish
text = "Covid-19 га қарши эмлаш бошланди," inputs = tokenizer(text, return_tensors="pt")
outputs = model(**inputs, labels=inputs["input_ids"]) loss, logits = outputs[:2] predicted_index = torch.argmax(logits[0, -1, :]).item() predicted_text = tokenizer.decode([predicted_index])
print('input text:', text) print('predicted text:', predicted_text)
Bitta to'liq ketma-ketlikni yarating
text = "Covid-19 га қарши эмлаш бошланди, "
inputs = tokenizer(text, return_tensors="pt")
sample_outputs = model.generate(inputs.input_ids,
pad_token_id=50256,
do_sample=True,
max_length=50, # kerakli token raqamini qo'ying
top_k=40,
num_return_sequences=1)
for i, sample_output in enumerate(sample_outputs):
print(">> Generated text {}\n\n{}".format(i+1, tokenizer.decode(sample_output.tolist())))
@misc {rifkat_davronov_2022,
authors = { {Adilova Fatima,Rifkat Davronov, Samariddin Kushmuratov, Ruzmat Safarov} },
title = { GPTuz (Revision 2a7e6c0) },
year = 2022,
url = { https://huggingface.co/rifkat/GPTuz },
doi = { 10.57967/hf/0143 },
publisher = { Hugging Face }
}
- Downloads last month
- 11