first try
Browse files- __pycache__/handler.cpython-310.pyc +0 -0
- hanler.py → handler.py +0 -0
- poetry.lock +0 -0
- pyproject.toml +16 -0
- test.py +31 -0
__pycache__/handler.cpython-310.pyc
ADDED
|
Binary file (2.17 kB). View file
|
|
|
hanler.py → handler.py
RENAMED
|
File without changes
|
poetry.lock
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
pyproject.toml
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
[tool.poetry]
|
| 2 |
+
name = "visado"
|
| 3 |
+
version = "0.1.0"
|
| 4 |
+
description = ""
|
| 5 |
+
authors = ["mateuor2d2 <mateuor2d2@gmail.com>"]
|
| 6 |
+
readme = "README.md"
|
| 7 |
+
|
| 8 |
+
[tool.poetry.dependencies]
|
| 9 |
+
python = "^3.10"
|
| 10 |
+
torch = "^2.5.0"
|
| 11 |
+
transformers = "^4.45.2"
|
| 12 |
+
|
| 13 |
+
|
| 14 |
+
[build-system]
|
| 15 |
+
requires = ["poetry-core"]
|
| 16 |
+
build-backend = "poetry.core.masonry.api"
|
test.py
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
from handler import EndpointHandler
|
| 2 |
+
|
| 3 |
+
# init handler
|
| 4 |
+
my_handler = EndpointHandler(path=".")
|
| 5 |
+
# prepare sample payload
|
| 6 |
+
text = """We introduce Mistral 7B, a 7–billion-parameter language model engineered for
|
| 7 |
+
superior performance and efficiency. Mistral 7B outperforms the best open 13B
|
| 8 |
+
model (Llama 2) across all evaluated benchmarks, and the best released 34B
|
| 9 |
+
model (Llama 1) in reasoning, mathematics, and code generation. Our model
|
| 10 |
+
leverages grouped-query attention (GQA) for faster inference, coupled with sliding
|
| 11 |
+
window attention (SWA) to effectively handle sequences of arbitrary length with a
|
| 12 |
+
reduced inference cost. We also provide a model fine-tuned to follow instructions,
|
| 13 |
+
Mistral 7B – Instruct, that surpasses Llama 2 13B – chat model both on human and
|
| 14 |
+
automated benchmarks. Our models are released under the Apache 2.0 license.
|
| 15 |
+
Code: <https://github.com/mistralai/mistral-src>
|
| 16 |
+
Webpage: <https://mistral.ai/news/announcing-mistral-7b/>"""
|
| 17 |
+
|
| 18 |
+
template = """{
|
| 19 |
+
"Model": {
|
| 20 |
+
"Name": "",
|
| 21 |
+
"Number of parameters": "",
|
| 22 |
+
"Number of max token": "",
|
| 23 |
+
"Architecture": []
|
| 24 |
+
},
|
| 25 |
+
"Usage": {
|
| 26 |
+
"Use case": [],
|
| 27 |
+
"Licence": ""
|
| 28 |
+
}
|
| 29 |
+
}"""
|
| 30 |
+
resultado=my_handler({"inputs": {"text": text, "template": template}})
|
| 31 |
+
print(resultado)
|