Delete handler.py
Browse files- handler.py +0 -18
handler.py
DELETED
|
@@ -1,18 +0,0 @@
|
|
| 1 |
-
import requests
|
| 2 |
-
|
| 3 |
-
class EndpointHandler:
|
| 4 |
-
def __init__(self, path=""):
|
| 5 |
-
self.api_url = "http://localhost:8000/v1/completions"
|
| 6 |
-
self.headers = {"Content-Type": "application/json"}
|
| 7 |
-
|
| 8 |
-
def __call__(self, data):
|
| 9 |
-
prompt = data.get("inputs", "")
|
| 10 |
-
payload = {
|
| 11 |
-
"model": "TanyaVM/MistralAWQ2",
|
| 12 |
-
"prompt": prompt,
|
| 13 |
-
"max_tokens": 1500,
|
| 14 |
-
}
|
| 15 |
-
|
| 16 |
-
response = requests.post(self.api_url, json=payload, headers=self.headers)
|
| 17 |
-
result = response.json()
|
| 18 |
-
return result
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|