Upload folder using huggingface_hub
Browse files
README.md
CHANGED
|
@@ -96,6 +96,18 @@ This model predicts MBTI personality type from text using a multi-task learning
|
|
| 96 |
- F: 54%, T: 46% (balanced)
|
| 97 |
- J: 60%, P: 40% (moderately imbalanced)
|
| 98 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 99 |
## Usage
|
| 100 |
|
| 101 |
### Requirements
|
|
@@ -107,8 +119,8 @@ This model predicts MBTI personality type from text using a multi-task learning
|
|
| 107 |
### Installation
|
| 108 |
|
| 109 |
```bash
|
| 110 |
-
git clone https://github.com/
|
| 111 |
-
cd
|
| 112 |
|
| 113 |
# Set up environment
|
| 114 |
conda create -n psycial python=3.10
|
|
@@ -121,11 +133,32 @@ export LIBTORCH_BYPASS_VERSION_CHECK=1
|
|
| 121 |
cargo build --release
|
| 122 |
```
|
| 123 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 124 |
### Inference
|
| 125 |
|
| 126 |
```bash
|
| 127 |
-
#
|
| 128 |
-
./target/release/psycial hybrid train --multi-task
|
| 129 |
|
| 130 |
# Predict single text
|
| 131 |
./target/release/psycial hybrid predict "I love solving complex problems and thinking deeply about abstract concepts."
|
|
@@ -140,6 +173,16 @@ use psycial::hybrid::predict::predict_single;
|
|
| 140 |
predict_single("Your text here")?;
|
| 141 |
```
|
| 142 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 143 |
## Model Files
|
| 144 |
|
| 145 |
This model repository includes:
|
|
|
|
| 96 |
- F: 54%, T: 46% (balanced)
|
| 97 |
- J: 60%, P: 40% (moderately imbalanced)
|
| 98 |
|
| 99 |
+
## ⚠️ Important Note
|
| 100 |
+
|
| 101 |
+
**This model does NOT support Hugging Face Inference API** because it's a custom Rust/PyTorch implementation, not a standard `transformers` model.
|
| 102 |
+
|
| 103 |
+
To use this model, you have two options:
|
| 104 |
+
|
| 105 |
+
### Option 1: Use the Web Interface (Easiest)
|
| 106 |
+
|
| 107 |
+
Visit **https://polyjuice.0xbase.ai** for instant MBTI predictions - no setup required!
|
| 108 |
+
|
| 109 |
+
### Option 2: Run Locally (Full Control)
|
| 110 |
+
|
| 111 |
## Usage
|
| 112 |
|
| 113 |
### Requirements
|
|
|
|
| 119 |
### Installation
|
| 120 |
|
| 121 |
```bash
|
| 122 |
+
git clone https://github.com/RyanKung/polyjuice
|
| 123 |
+
cd polyjuice
|
| 124 |
|
| 125 |
# Set up environment
|
| 126 |
conda create -n psycial python=3.10
|
|
|
|
| 133 |
cargo build --release
|
| 134 |
```
|
| 135 |
|
| 136 |
+
### Download Model from Hugging Face
|
| 137 |
+
|
| 138 |
+
```python
|
| 139 |
+
from huggingface_hub import hf_hub_download
|
| 140 |
+
|
| 141 |
+
# Download model files
|
| 142 |
+
mlp_weights = hf_hub_download(
|
| 143 |
+
repo_id="ElderRyan/polyjuice",
|
| 144 |
+
filename="mlp_weights_multitask.pt"
|
| 145 |
+
)
|
| 146 |
+
|
| 147 |
+
vectorizer = hf_hub_download(
|
| 148 |
+
repo_id="ElderRyan/polyjuice",
|
| 149 |
+
filename="tfidf_vectorizer_multitask.json"
|
| 150 |
+
)
|
| 151 |
+
|
| 152 |
+
# Copy to models directory
|
| 153 |
+
import shutil
|
| 154 |
+
shutil.copy(mlp_weights, "models/mlp_weights_multitask.pt")
|
| 155 |
+
shutil.copy(vectorizer, "models/tfidf_vectorizer_multitask.json")
|
| 156 |
+
```
|
| 157 |
+
|
| 158 |
### Inference
|
| 159 |
|
| 160 |
```bash
|
| 161 |
+
# Download model files first (see above)
|
|
|
|
| 162 |
|
| 163 |
# Predict single text
|
| 164 |
./target/release/psycial hybrid predict "I love solving complex problems and thinking deeply about abstract concepts."
|
|
|
|
| 173 |
predict_single("Your text here")?;
|
| 174 |
```
|
| 175 |
|
| 176 |
+
### Quick Test
|
| 177 |
+
|
| 178 |
+
```bash
|
| 179 |
+
# Download inference example
|
| 180 |
+
wget https://huggingface.co/ElderRyan/polyjuice/raw/main/inference_example.py
|
| 181 |
+
|
| 182 |
+
# Run it
|
| 183 |
+
python inference_example.py
|
| 184 |
+
```
|
| 185 |
+
|
| 186 |
## Model Files
|
| 187 |
|
| 188 |
This model repository includes:
|