Downloads · 30 days
0
chaukhaphan/my-first-hf-model
my-first-hf-model is a machine learning model from chaukhaphan. Use it for the machine learning task on the model card, and read the license before you ship it in a product.
This is a sentiment analysis model based on DistilBERT.
Downloads · 30 days
0
Access
Public
Updated Jul 12, 2025
Repo size
—
Likes
0
Public
Click a slice to open those files.
.md1 KB · 62%
From the Hugging Face model README
This is a sentiment analysis model based on DistilBERT.
from transformers import pipeline
classifier = pipeline("sentiment-analysis", model="chaukhaphan/my-first-hf-model")
classifier("I love deploying models!")
You can edit it:
- Locally and `git push`
- Or directly on the Hugging Face web UI
---
## 🚀 3. **Create a Live Web Demo with Gradio (Space)**
This lets non-technical users interact with your model via a **drag-and-drop UI**.
### How:
1. Go to: [https://huggingface.co/spaces](https://huggingface.co/spaces)
2. Click **Create new Space**
3. Choose:
- SDK: **Gradio**
- Name: e.g., `my-sentiment-app`
- Hardware: CPU is fine
4. Create `app.py`:
```python
import gradio as gr
from transformers import pipeline
clf = pipeline("sentiment-analysis", model="chaukhaphan/my-first-hf-model")
def analyze(text):
return clf(text)[0]
gr.Interface(fn=analyze, inputs="text", outputs="label", title="Sentiment Analyzer").launch()