mirror of
https://github.com/katanemo/plano.git
synced 2026-06-29 15:49:40 +02:00
lint + formating with black (#158)
* lint + formating with black * add black as pre commit
This commit is contained in:
parent
498e7f9724
commit
5c4a6bc8ff
22 changed files with 581 additions and 295 deletions
|
|
@ -7,7 +7,12 @@ from app.load_models import (
|
|||
get_device,
|
||||
)
|
||||
import os
|
||||
from app.utils import GuardHandler, split_text_into_chunks, load_yaml_config, get_model_server_logger
|
||||
from app.utils import (
|
||||
GuardHandler,
|
||||
split_text_into_chunks,
|
||||
load_yaml_config,
|
||||
get_model_server_logger,
|
||||
)
|
||||
import torch
|
||||
import yaml
|
||||
import string
|
||||
|
|
@ -39,6 +44,7 @@ guard_handler = GuardHandler(toxic_model=None, jailbreak_model=jailbreak_model)
|
|||
|
||||
app = FastAPI()
|
||||
|
||||
|
||||
class EmbeddingRequest(BaseModel):
|
||||
input: str
|
||||
model: str
|
||||
|
|
@ -84,6 +90,7 @@ async def embedding(req: EmbeddingRequest, res: Response):
|
|||
}
|
||||
return {"data": data, "model": req.model, "object": "list", "usage": usage}
|
||||
|
||||
|
||||
class GuardRequest(BaseModel):
|
||||
input: str
|
||||
task: str
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue