Text Generation
Transformers
PyTorch
JAX
English
gpt2
India
politics
tweets
BJP
Congress
AAP
lm-head
text-generation-inference
Instructions to use abagade/IndianPoliticalTweetsLM with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use abagade/IndianPoliticalTweetsLM with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="abagade/IndianPoliticalTweetsLM")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("abagade/IndianPoliticalTweetsLM") model = AutoModelForCausalLM.from_pretrained("abagade/IndianPoliticalTweetsLM", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use abagade/IndianPoliticalTweetsLM with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "abagade/IndianPoliticalTweetsLM" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "abagade/IndianPoliticalTweetsLM", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/abagade/IndianPoliticalTweetsLM
- SGLang
How to use abagade/IndianPoliticalTweetsLM 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 "abagade/IndianPoliticalTweetsLM" \ --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": "abagade/IndianPoliticalTweetsLM", "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 "abagade/IndianPoliticalTweetsLM" \ --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": "abagade/IndianPoliticalTweetsLM", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use abagade/IndianPoliticalTweetsLM with Docker Model Runner:
docker model run hf.co/abagade/IndianPoliticalTweetsLM
Update README.md
Browse files
README.md
CHANGED
|
@@ -22,6 +22,7 @@ datasets:
|
|
| 22 |
Indian Political Tweets LM
|
| 23 |
|
| 24 |
## Model description
|
|
|
|
| 25 |
|
| 26 |
This is a GPT2 Language model with LM head fine-tuned on tweets crawled from handles which belong predominantly to Indian Politics. For more information about the crawled data, you can go through this [blog](https://bagdeabhishek.github.io/twitterAnalysis) post.
|
| 27 |
|
|
|
|
| 22 |
Indian Political Tweets LM
|
| 23 |
|
| 24 |
## Model description
|
| 25 |
+
Note: This model is based on GPT2, if you want a bigger model based on GPT2-medium and finetuned on the same data please take a look at the [IndianPoliticalTweetsLMMedium](https://huggingface.co/bagdaebhishek/IndianPoliticalTweetsLMMedium) model.
|
| 26 |
|
| 27 |
This is a GPT2 Language model with LM head fine-tuned on tweets crawled from handles which belong predominantly to Indian Politics. For more information about the crawled data, you can go through this [blog](https://bagdeabhishek.github.io/twitterAnalysis) post.
|
| 28 |
|