Skip to content

Commit

Permalink
update fn
Browse files Browse the repository at this point in the history
  • Loading branch information
aniketmaurya committed Dec 6, 2023
1 parent 26f863b commit e0df5c3
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 8 deletions.
7 changes: 3 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,19 +24,18 @@ python -m fastserve
from fastserve.models import ServeLlamaCpp

model_path = "openhermes-2-mistral-7b.Q5_K_M.gguf"
serve = ServeLlamaCpp(model_path=model_path,)
serve = ServeLlamaCpp(model_path=model_path, )
serve.run_server()
```

or, run `python -m fastserve.models --model llama-cpp --model_path openhermes-2-mistral-7b.Q5_K_M.gguf` from terminal.


### Serve SDXL Turbo

```python
from fastserve.models import ServeSSD1B
from fastserve.models import ServeSDXLTurbo

serve = ServeSSD1B(device="cuda", batch_size=2, timeout=1)
serve = ServeSDXLTurbo(device="cuda", batch_size=2, timeout=1)
serve.run_server()
```

Expand Down
2 changes: 1 addition & 1 deletion src/fastserve/models/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
from .ssd import ServeSSD1B
from .sdxl_turbo import SDXLTurboServe
from .sdxl_turbo import ServeSDXLTurbo
from .llama_cpp import ServeLlamaCpp
4 changes: 2 additions & 2 deletions src/fastserve/models/__main__.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import argparse

from fastserve.utils import get_default_device
from . import SDXLTurboServe
from . import ServeSDXLTurbo
from .llama_cpp import ServeLlamaCpp
from .ssd import ServeSSD1B

Expand Down Expand Up @@ -38,7 +38,7 @@
if args.model == "ssd-1b":
app = ServeSSD1B(device=device, timeout=args.timeout, batch_size=args.batch_size)
elif args.model == "sdxl-turbo":
app = SDXLTurboServe(
app = ServeSDXLTurbo(
device=device, timeout=args.timeout, batch_size=args.batch_size
)

Expand Down
2 changes: 1 addition & 1 deletion src/fastserve/models/sdxl_turbo.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class PromptRequest(BaseModel):
negative_prompt: str = "ugly, blurry, poor quality"


class SDXLTurboServe(FastServe):
class ServeSDXLTurbo(FastServe):
def __init__(
self, batch_size=1, timeout=0.0, device="cuda", num_inference_steps: int = 1
) -> None:
Expand Down

0 comments on commit e0df5c3

Please sign in to comment.