Merge branch 'main' of https://huggingface.co/zeroshot/sst2-distilbert-sparse into main
Browse files
README.md
CHANGED
|
@@ -1,6 +1,9 @@
|
|
| 1 |
---
|
| 2 |
license: apache-2.0
|
| 3 |
---
|
|
|
|
|
|
|
|
|
|
| 4 |
This model is π
|
| 5 |
|
| 6 |
ββββββββ βββββββ ββββββ βββββββ ββββββββ ββββββββ
|
|
@@ -11,6 +14,45 @@ This model is π
|
|
| 11 |
ββββββββ βββ βββ βββ βββ ββ βββββββββ ββββββββ
|
| 12 |
|
| 13 |

|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 14 |
Μ·ΜΝ
|
| 15 |
Μ΅ΝΜ³RΜΆΝΜiΜΈΝΜcΜ΄ΜΜ»kΜΈΜΝyΜ·ΝΜ³
|
| 16 |
ΜΈΜΜͺ
|
|
|
|
| 1 |
---
|
| 2 |
license: apache-2.0
|
| 3 |
---
|
| 4 |
+
|
| 5 |
+
### DISTILBERT RUNNING ON [DEEPSPARSE](https://github.com/neuralmagic/deepsparse) ENGINE GOES BRHMMMMMMMM. πππ
|
| 6 |
+
|
| 7 |
This model is π
|
| 8 |
|
| 9 |
ββββββββ βββββββ ββββββ βββββββ ββββββββ ββββββββ
|
|
|
|
| 14 |
ββββββββ βββ βββ βββ βββ ββ βββββββββ ββββββββ
|
| 15 |
|
| 16 |

|
| 17 |
+
|
| 18 |
+
|
| 19 |
+
### LOOKS LIKE THIS π
|
| 20 |
+
|
| 21 |
+

|
| 22 |
+
|
| 23 |
+
### Inference endpoints, outside of outliers (4ms) is avg. latency on 2 vCPUs:
|
| 24 |
+
|
| 25 |
+

|
| 26 |
+
|
| 27 |
+
|
| 28 |
+
### Handler for access to inference endpoints
|
| 29 |
+
|
| 30 |
+
```python
|
| 31 |
+
class EndpointHandler:
|
| 32 |
+
|
| 33 |
+
def __init__(self, path=""):
|
| 34 |
+
|
| 35 |
+
self.pipeline = Pipeline.create(task="text-classification", model_path=path)
|
| 36 |
+
|
| 37 |
+
def __call__(self, data: Dict[str, Any]) -> Dict[str, str]:
|
| 38 |
+
"""
|
| 39 |
+
Args:
|
| 40 |
+
data (:obj:): prediction input text
|
| 41 |
+
"""
|
| 42 |
+
inputs = data.pop("inputs", data)
|
| 43 |
+
|
| 44 |
+
start = perf_counter()
|
| 45 |
+
prediction = self.pipeline(inputs)
|
| 46 |
+
end = perf_counter()
|
| 47 |
+
delta = end - start
|
| 48 |
+
|
| 49 |
+
return {
|
| 50 |
+
"labels":prediction.labels,
|
| 51 |
+
"scores": prediction.scores,
|
| 52 |
+
"latency (secs.)": str(delta)
|
| 53 |
+
}
|
| 54 |
+
```
|
| 55 |
+
|
| 56 |
Μ·ΜΝ
|
| 57 |
Μ΅ΝΜ³RΜΆΝΜiΜΈΝΜcΜ΄ΜΜ»kΜΈΜΝyΜ·ΝΜ³
|
| 58 |
ΜΈΜΜͺ
|