Skip to content

Commit

Permalink
Merge branch 'feat/vll-m' of https://github.com/aniketmaurya/fastserv…
Browse files Browse the repository at this point in the history
…e-ai into feat/vll-m
  • Loading branch information
aniketmaurya committed Feb 23, 2024
2 parents ab62511 + fdd7c75 commit 6c7deb1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/fastserve/models/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@
from fastserve.models.llama_cpp import ServeLlamaCpp as ServeLlamaCpp
from fastserve.models.sdxl_turbo import ServeSDXLTurbo as ServeSDXLTurbo
from fastserve.models.ssd import ServeSSD1B as ServeSSD1B
from fastserve.models.vllm import ServeVLLM as ServeVLLM
from fastserve.models.vllm import ServeVLLM as ServeVLLM
9 changes: 4 additions & 5 deletions src/fastserve/models/vllm.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
import logging
import os
from typing import Any, List, Optional

from pydantic import BaseModel, Field
from pydantic import BaseModel

from fastserve.core import FastServe

logger = logging.getLogger(__name__)



class PromptRequest(BaseModel):
prompt: str = "Write a python function to resize image to 224x224"
temperature: float = 0.8
Expand Down Expand Up @@ -50,8 +48,9 @@ def __call__(self, request: PromptRequest) -> Any:
from vllm import SamplingParams

sampling_params = SamplingParams(
temperature=request.temperature, top_p=request.top_p,
max_tokens=request.max_tokens
temperature=request.temperature,
top_p=request.top_p,
max_tokens=request.max_tokens,
)
result = self.llm.generate(request.prompt, sampling_params=sampling_params)
logger.info(result)
Expand Down

0 comments on commit 6c7deb1

Please sign in to comment.