Update README.md
Browse files
README.md
CHANGED
@@ -106,25 +106,25 @@ This project was completed to explore the effectiveness of parameter-efficient f
|
|
106 |
|
107 |
### Usage
|
108 |
|
109 |
-
|
110 |
-
|
111 |
-
|
112 |
-
|
113 |
-
|
114 |
-
|
115 |
-
|
116 |
-
|
117 |
-
|
118 |
-
|
119 |
-
|
120 |
-
|
121 |
-
|
122 |
-
|
123 |
-
|
124 |
-
|
125 |
-
|
126 |
-
|
127 |
-
|
128 |
-
|
129 |
-
|
130 |
-
|
|
|
106 |
|
107 |
### Usage
|
108 |
|
109 |
+
To use this model, follow these steps:
|
110 |
+
|
111 |
+
1. **Log in to Hugging Face**:
|
112 |
+
```bash
|
113 |
+
huggingface-cli login
|
114 |
+
```
|
115 |
+
|
116 |
+
2. **Load the model**:
|
117 |
+
```python
|
118 |
+
from transformers import AutoTokenizer, AutoModelForSequenceClassification
|
119 |
+
|
120 |
+
tokenizer = AutoTokenizer.from_pretrained("jamander/Project-Blockbuster")
|
121 |
+
model = AutoModelForSequenceClassification.from_pretrained("jamander/Project-Blockbuster")
|
122 |
+
```
|
123 |
+
|
124 |
+
3. **Tokenize and predict**:
|
125 |
+
```python
|
126 |
+
inputs = tokenizer("I loved the movie!", return_tensors="pt", padding=True, truncation=True)
|
127 |
+
outputs = model(**inputs)
|
128 |
+
prediction = torch.argmax(outputs.logits, dim=-1)
|
129 |
+
print("Prediction:", "Positive" if prediction == 1 else "Negative")
|
130 |
+
|