Instructions to use Pavithrapn-01/sentiment-analyzer with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- PEFT
How to use Pavithrapn-01/sentiment-analyzer with PEFT:
from peft import PeftModel from transformers import AutoModelForCausalLM base_model = AutoModelForCausalLM.from_pretrained("google/gemma-2b") model = PeftModel.from_pretrained(base_model, "Pavithrapn-01/sentiment-analyzer") - Transformers
How to use Pavithrapn-01/sentiment-analyzer with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="Pavithrapn-01/sentiment-analyzer")# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("Pavithrapn-01/sentiment-analyzer", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use Pavithrapn-01/sentiment-analyzer with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Pavithrapn-01/sentiment-analyzer" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Pavithrapn-01/sentiment-analyzer", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/Pavithrapn-01/sentiment-analyzer
- SGLang
How to use Pavithrapn-01/sentiment-analyzer 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 "Pavithrapn-01/sentiment-analyzer" \ --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": "Pavithrapn-01/sentiment-analyzer", "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 "Pavithrapn-01/sentiment-analyzer" \ --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": "Pavithrapn-01/sentiment-analyzer", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use Pavithrapn-01/sentiment-analyzer with Docker Model Runner:
docker model run hf.co/Pavithrapn-01/sentiment-analyzer
Update README.md
Browse files
README.md
CHANGED
|
@@ -1,79 +1,16 @@
|
|
| 1 |
-
---
|
| 2 |
-
base_model: google/gemma-2b
|
| 3 |
-
library_name: peft
|
| 4 |
-
pipeline_tag: text-generation
|
| 5 |
-
tags:
|
| 6 |
-
- sentiment-analysis
|
| 7 |
-
- lora
|
| 8 |
-
- transformers
|
| 9 |
-
- peft
|
| 10 |
-
---
|
| 11 |
-
|
| 12 |
-
# Sentiment Analyzer
|
| 13 |
-
|
| 14 |
-
A fine-tuned sentiment analysis model developed and shared by **Pavithrapn-01**.
|
| 15 |
-
This model is designed to analyze text and classify sentiment efficiently using a lightweight fine-tuning approach.
|
| 16 |
-
|
| 17 |
-
---
|
| 18 |
-
|
| 19 |
-
## Model Details
|
| 20 |
-
|
| 21 |
-
### Model Description
|
| 22 |
-
This model is a **sentiment analysis system** built by fine-tuning the **google/gemma-2b** base model using **LoRA (Low-Rank Adaptation)**.
|
| 23 |
-
It is optimized for understanding emotional polarity in text such as **positive, negative, or neutral sentiment**.
|
| 24 |
-
|
| 25 |
-
- **Developed by:** Pavithra PN
|
| 26 |
-
- **Shared by:** Pavithrapn-01
|
| 27 |
-
- **Model type:** Text Generation / Sentiment Analysis
|
| 28 |
-
- **Language(s):** English
|
| 29 |
-
- **License:** Open-source (same as base model)
|
| 30 |
-
- **Finetuned from model:** google/gemma-2b
|
| 31 |
-
|
| 32 |
-
---
|
| 33 |
-
|
| 34 |
-
## Model Sources
|
| 35 |
-
|
| 36 |
-
- **Repository:** Pavithrapn-01/sentiment-analyzer
|
| 37 |
-
- **Base Model:** google/gemma-2b
|
| 38 |
-
|
| 39 |
-
---
|
| 40 |
-
|
| 41 |
-
## Uses
|
| 42 |
-
|
| 43 |
-
### Direct Use
|
| 44 |
-
- Sentiment analysis of user reviews
|
| 45 |
-
- Opinion mining from social media text
|
| 46 |
-
- Feedback and survey analysis
|
| 47 |
-
- Educational and academic projects
|
| 48 |
-
|
| 49 |
-
### Downstream Use
|
| 50 |
-
- Can be integrated into chatbots
|
| 51 |
-
- Can be used in recommendation systems
|
| 52 |
-
- Can be further fine-tuned for domain-specific sentiment tasks
|
| 53 |
-
|
| 54 |
-
### Out-of-Scope Use
|
| 55 |
-
- Medical or legal decision-making
|
| 56 |
-
- High-risk or safety-critical applications
|
| 57 |
-
- Multilingual sentiment analysis (English only)
|
| 58 |
-
|
| 59 |
-
---
|
| 60 |
-
|
| 61 |
-
## Bias, Risks, and Limitations
|
| 62 |
-
|
| 63 |
-
- The model may reflect biases present in the training data
|
| 64 |
-
- Performance may vary on slang, sarcasm, or ambiguous text
|
| 65 |
-
- Best suited for short to medium-length text inputs
|
| 66 |
-
|
| 67 |
-
### Recommendations
|
| 68 |
-
Users should validate outputs before deploying the model in real-world applications and avoid using it for sensitive decision-making.
|
| 69 |
|
| 70 |
---
|
| 71 |
|
| 72 |
-
##
|
|
|
|
|
|
|
|
|
|
|
|
|
| 73 |
|
| 74 |
-
|
| 75 |
-
|
|
|
|
|
|
|
|
|
|
| 76 |
|
| 77 |
-
|
| 78 |
-
result = classifier("I really enjoyed using this application!")
|
| 79 |
-
print(result)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
|
| 2 |
---
|
| 3 |
|
| 4 |
+
### ✅ What I’ve Done
|
| 5 |
+
- Added **your Hugging Face username**
|
| 6 |
+
- Customized it for **sentiment analysis**
|
| 7 |
+
- Made it **ready for Hugging Face Model Hub**
|
| 8 |
+
- Cleaned all `[More Information Needed]` sections
|
| 9 |
|
| 10 |
+
If you want, I can also:
|
| 11 |
+
- Make it **shorter**
|
| 12 |
+
- Add **accuracy numbers**
|
| 13 |
+
- Customize it for **college/project submission**
|
| 14 |
+
- Align it with your **BCA profile**
|
| 15 |
|
| 16 |
+
Just tell me 😊
|
|
|
|
|
|