zeroshot commited on
Commit
7e0b8ee
Β·
1 Parent(s): 9b70dfb

add files

Browse files
Files changed (4) hide show
  1. .gitignore +2 -0
  2. README.md +14 -0
  3. handler.py +23 -0
  4. requirements.txt +1 -0
.gitignore ADDED
@@ -0,0 +1,2 @@
 
 
 
1
+ dev.py
2
+ env/
README.md CHANGED
@@ -1,3 +1,17 @@
1
  ---
2
  license: apache-2.0
3
  ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  ---
2
  license: apache-2.0
3
  ---
4
+ This model is πŸ‘‡
5
+
6
+ β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•— β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•— β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•— β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•— β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•— β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—
7
+ β–ˆβ–ˆβ•”β•β•β•β•β• β–ˆβ–ˆβ•”β•β•β–ˆβ–ˆβ•— β–ˆβ–ˆβ•”β•β•β–ˆβ–ˆβ•— β–ˆβ–ˆβ•”β•β•β–ˆβ–ˆβ•— β–ˆβ–ˆβ•”β•β•β•β•β• β–ˆβ–ˆβ•”β•β•β•β•β•
8
+ β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•— β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•”β• β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•‘ β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•”β• β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•— β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—
9
+ β•šβ•β•β•β•β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ•”β•β•β•β• β–ˆβ–ˆβ•”β•β•β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ•”β•β•β–ˆβ–ˆβ•— β•šβ•β•β•β•β–ˆβ–ˆβ•‘β–ˆ β–ˆβ•”β•β•β•
10
+ β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•‘ β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ•‘ β–ˆβ–ˆ β•‘β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•‘ β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—
11
+ β•šβ•β•β•β•β•β•β• β•šβ•β• β•šβ•β• β•šβ•β• β•šβ•β• β•šβ• β•β•šβ•β•β•β•β•β•β• β•šβ•β•β•β•β•β•β•
12
+
13
+ ![Alt Text](https://media.giphy.com/media/4Hmjz2sqdtASJ2gFMH/giphy.gif)
14
+ ̷͈̍
15
+ Μ΅Ν’Μ³RΜΆΝƒΜ™i̸̟͘cΜ΄Μ†Μ»kΜΈΜ‘ΝœyΜ·Ν„Μ³
16
+ ̸̚Μͺ
17
+ Μ·Ν€Ν–
handler.py ADDED
@@ -0,0 +1,23 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from typing import Dict, Any
2
+ from deepsparse import Pipeline
3
+ from time import perf_counter
4
+
5
+ class EndpointHandler:
6
+
7
+ def __init__(self, path=""):
8
+
9
+ self.pipeline = Pipeline.create(task="text-classification", model_path=path)
10
+
11
+ def __call__(self, data: Dict[str, Any]) -> Dict[str, str]:
12
+ """
13
+ Args:
14
+ data (:obj:): prediction input text
15
+ """
16
+ inputs = data.pop("inputs", data)
17
+
18
+ start = perf_counter()
19
+ prediction = self.pipeline(inputs)
20
+ end = perf_counter()
21
+ delta = end - start
22
+
23
+ return prediction.json(), "latency: " + str(delta) + " secs."
requirements.txt ADDED
@@ -0,0 +1 @@
 
 
1
+ deepsparse>=1.2.0