Skip to content

Commit

Permalink
fix changes
Browse files Browse the repository at this point in the history
  • Loading branch information
luv-bansal committed Feb 5, 2025
1 parent 1750d1e commit 844b9ad
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import sys
from typing import Iterator

from clarifai.runners.models.model_class import ModelClass
from clarifai.runners.models.model_runner import ModelRunner
from clarifai.utils.logging import logger
from clarifai_grpc.grpc.api import resources_pb2, service_pb2
from clarifai_grpc.grpc.api.status import status_code_pb2
Expand Down Expand Up @@ -76,13 +76,15 @@ def start_server(self, python_executable, checkpoints):
raise RuntimeError("Failed to start sglang server: " + str(e))


class MyModel(ModelClass):
class MyModel(ModelRunner):
"""A custom runner that loads the model and generates text using SGLang Inference.
"""

def load_model(self):
"""Load the model here and start the openai sglang server."""

checkpoints = "casperhansen/llama-3.3-70b-instruct-awq"

# SGLang parameters
self.mem_fraction_static = 0.9
self.tensor_parallel_size = 1
Expand All @@ -105,11 +107,6 @@ def load_model(self):

python_executable = sys.executable

# if checkpoints section is in config.yaml file then checkpoints will be downloaded at this path during model upload time.
# checkpoints = os.path.join(os.path.dirname(__file__), "checkpoints")

checkpoints = "casperhansen/llama-3.3-70b-instruct-awq"

try:
# Start the sglang server
self.server_manager.start_server(python_executable, checkpoints)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

model:
id: "sglang-llama-3_3-70b-instruct"
user_id: "meta"
app_id: "Llama-3"
user_id: "user_id"
app_id: "app_id"
model_type_id: "text-to-text"

build_info:
Expand Down

0 comments on commit 844b9ad

Please sign in to comment.