Instructions to use tsaditya/GPT-Kalki with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use tsaditya/GPT-Kalki with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="tsaditya/GPT-Kalki")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("tsaditya/GPT-Kalki") model = AutoModelForCausalLM.from_pretrained("tsaditya/GPT-Kalki") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use tsaditya/GPT-Kalki with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "tsaditya/GPT-Kalki" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "tsaditya/GPT-Kalki", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/tsaditya/GPT-Kalki
- SGLang
How to use tsaditya/GPT-Kalki 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 "tsaditya/GPT-Kalki" \ --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": "tsaditya/GPT-Kalki", "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 "tsaditya/GPT-Kalki" \ --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": "tsaditya/GPT-Kalki", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use tsaditya/GPT-Kalki with Docker Model Runner:
docker model run hf.co/tsaditya/GPT-Kalki
YAML Metadata Error:"datasets[2]" with value "Wiki-Tamil novels scrapped data" is not valid. If possible, use a dataset id from https://hf.co/datasets.
- GPT2-Kalki
- Model description
- Dataset Used:
- Usage
- You can use this model for Tamil text generation:
python >>> from transformers import AutoTokenizer, AutoModelWithLMHead, pipeline >>> tokenizer = AutoTokenizer.from_pretrained('tsaditya/GPT-Kalki') >>> model = AutoModelWithLMHead.from_pretrained('tsaditya/GPT-Kalki') >>> text = "ஆதித்த கரிகாலர் தஞ்சைக்குச் செல்ல உடனடியாக ஒப்புக்கொண்டார். " >>> encoded_text = tokenizer.encode(text, return_tensors='tf') >>> beam_output = model.generate( encoded_text, do_sample=True, max_length=512, top_k=50, top_p=0.95, num_return_sequences=1, no_repeat_ngram_size = 3, temperature = 0.7 ) >>> print(tokenizer.decode(beam_output[0], skip_special_tokens=True))
- Model description
GPT2-Kalki
Model description
GPT2-Kalki is a GPT-2 transformer model fine-tuned on corpus of Tamil language data from Wikipedia. Has been specifically finetuned on the works of Kalki Krishnamurthy - a Tamil writer from the 1900s. This model is an experimentation of "What if" scenarios using the characters of his novels. The famous movie that has been released now Ponniyin Selvan - I is based on the novel written by the same author. This model is trained on an already trained model on Tamil dataset from GPT2-Tamil.
Dataset Used:
The GTP-2 model is trained on oscar dataset - ta and IndicNLP dataset - ta and manually scrapped Wikipedia dataset specifically having stories and novels. The scrapped dataset will be released soon.
Usage
You can use this model for Tamil text generation:
python >>> from transformers import AutoTokenizer, AutoModelWithLMHead, pipeline >>> tokenizer = AutoTokenizer.from_pretrained('tsaditya/GPT-Kalki') >>> model = AutoModelWithLMHead.from_pretrained('tsaditya/GPT-Kalki') >>> text = "ஆதித்த கரிகாலர் தஞ்சைக்குச் செல்ல உடனடியாக ஒப்புக்கொண்டார். " >>> encoded_text = tokenizer.encode(text, return_tensors='tf') >>> beam_output = model.generate( encoded_text, do_sample=True, max_length=512, top_k=50, top_p=0.95, num_return_sequences=1, no_repeat_ngram_size = 3, temperature = 0.7 ) >>> print(tokenizer.decode(beam_output[0], skip_special_tokens=True))
- Downloads last month
- 8