Text Generation
Transformers
Safetensors
gemma
conversational
text-generation-inference
4-bit precision
bitsandbytes
Instructions to use Lagstill/Varsity_module2_bot with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Lagstill/Varsity_module2_bot with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="Lagstill/Varsity_module2_bot") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("Lagstill/Varsity_module2_bot") model = AutoModelForCausalLM.from_pretrained("Lagstill/Varsity_module2_bot") messages = [ {"role": "user", "content": "Who are you?"}, ] inputs = tokenizer.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=40) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use Lagstill/Varsity_module2_bot with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Lagstill/Varsity_module2_bot" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Lagstill/Varsity_module2_bot", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/Lagstill/Varsity_module2_bot
- SGLang
How to use Lagstill/Varsity_module2_bot 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 "Lagstill/Varsity_module2_bot" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Lagstill/Varsity_module2_bot", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'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 "Lagstill/Varsity_module2_bot" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Lagstill/Varsity_module2_bot", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use Lagstill/Varsity_module2_bot with Docker Model Runner:
docker model run hf.co/Lagstill/Varsity_module2_bot
Updated
Browse files
README.md
CHANGED
|
@@ -1,3 +1,42 @@
|
|
| 1 |
---
|
| 2 |
license: gemma
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3 |
---
|
|
|
|
| 1 |
---
|
| 2 |
license: gemma
|
| 3 |
+
widget :
|
| 4 |
+
- text: "அகத்தின் அழகு"
|
| 5 |
+
example_title: "அகத்தின் அழகு"
|
| 6 |
+
- text : "கடுகு சிறுத்தாலும்"
|
| 7 |
+
example_title: "கடுகு சிறுத்தாலும்"
|
| 8 |
+
- text : "யானைக்கும் அடி"
|
| 9 |
+
example_title : "யானைக்கும் அடி"
|
| 10 |
+
---
|
| 11 |
+
# GPT2-Tamil
|
| 12 |
+
|
| 13 |
+
## Model description
|
| 14 |
+
GPT2-Tamil is a GPT-2 transformer model fine Tuned on a large corpus of Tamil data in a self-supervised fashion. This means it was pretrained on the raw texts only, with no humans labelling them in any way with an automatic process to generate inputs and labels from those texts. More precisely, it was trained to guess the next word in sentences.
|
| 15 |
+
|
| 16 |
+
More precisely, inputs are sequences of continuous text of a certain length and the targets are the same sequence, shifted one token (word or piece of word) to the right. The model uses internally a mask-mechanism to make sure the predictions for the token i only uses the inputs from 1 to i but not the future tokens.
|
| 17 |
+
|
| 18 |
+
This way, the model learns an inner representation of the Tamil language that can then be used to extract features useful for downstream tasks.
|
| 19 |
+
## Intended uses & limitations
|
| 20 |
+
|
| 21 |
+
You can use the raw model for text generation or fine-tune it to a downstream task. See the
|
| 22 |
+
[model hub](https://huggingface.co/models?filter=gpt2) to look for fine-tuned versions on a task that interests you.
|
| 23 |
+
|
| 24 |
+
## Usage
|
| 25 |
+
You can use this model for Tamil text generation:
|
| 26 |
+
```python
|
| 27 |
+
>>> from transformers import TFGPT2LMHeadModel, GPT2Tokenizer
|
| 28 |
+
>>> tokenizer = GPT2Tokenizer.from_pretrained("Lagstill/GPT-2-Tamil")
|
| 29 |
+
>>> model = TFGPT2LMHeadModel.from_pretrained("Lagstill/GPT-2-Tamil")
|
| 30 |
+
>>> text = "அகத்தின் அழகு"
|
| 31 |
+
>>> encoded_text = tokenizer.encode(text, return_tensors='tf')
|
| 32 |
+
>>> beam_output = model.generate(
|
| 33 |
+
encoded_text,
|
| 34 |
+
max_length=100,
|
| 35 |
+
num_beams=5,
|
| 36 |
+
temperature=0.7,
|
| 37 |
+
no_repeat_ngram_size=2,
|
| 38 |
+
num_return_sequences=5
|
| 39 |
+
)
|
| 40 |
+
>>> print(tokenizer.decode(beam_output[0], skip_special_tokens=True))
|
| 41 |
+
```
|
| 42 |
---
|