zeroshot commited on
Commit
2680798
·
2 Parent(s): a3a497b 4f602c5

Merge branch 'main' of https://huggingface.co/zeroshot/sst2-distilbert-sparse into main

Browse files
Files changed (1) hide show
  1. README.md +42 -0
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
  ![Alt Text](https://media.giphy.com/media/4Hmjz2sqdtASJ2gFMH/giphy.gif)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
14
  ̷͈̍
15
  ̵̳͒R̶̙̓i̸̟͘c̴̻̆k̸̑͜ÿ̷̳́
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
  ![Alt Text](https://media.giphy.com/media/4Hmjz2sqdtASJ2gFMH/giphy.gif)
17
+
18
+
19
+ ### LOOKS LIKE THIS 👇
20
+
21
+ ![Imgur](https://imgur.com/gWfX811.jpg)
22
+
23
+ ### Inference endpoints, outside of outliers (4ms) is avg. latency on 2 vCPUs:
24
+
25
+ ![Imgur](https://i.imgur.com/qceSdjZ.png)
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̸̑͜ÿ̷̳́
58
  ̸̪̚