mirror of
https://github.com/katanemo/plano.git
synced 2026-06-17 15:25:17 +02:00
Reorganize model_server
This commit is contained in:
parent
a40cdc7b75
commit
b4f4695f16
20 changed files with 20 additions and 20 deletions
2
model_server/.vscode/launch.json
vendored
2
model_server/.vscode/launch.json
vendored
|
|
@ -9,7 +9,7 @@
|
|||
"type": "debugpy",
|
||||
"request": "launch",
|
||||
"module": "uvicorn",
|
||||
"args": ["app.main:app","--reload", "--port", "51000"]
|
||||
"args": ["src.main:app","--reload", "--port", "51000"]
|
||||
}
|
||||
]
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,9 +1,9 @@
|
|||
import app.commons.utilities as utils
|
||||
import src.commons.utilities as utils
|
||||
|
||||
from openai import OpenAI
|
||||
from app.commons.constants import *
|
||||
from app.model_handler.function_calling import ArchIntentHandler, ArchFunctionHandler
|
||||
from app.model_handler.guardrails import get_guardrail_handler
|
||||
from src.commons.constants import *
|
||||
from src.core.function_calling import ArchIntentHandler, ArchFunctionHandler
|
||||
from src.core.guardrails import get_guardrail_handler
|
||||
|
||||
|
||||
logger = utils.get_model_server_logger()
|
||||
|
|
@ -5,14 +5,13 @@ import builtins
|
|||
from openai import OpenAI
|
||||
from typing import Any, Dict, List, Tuple, Union
|
||||
from overrides import override
|
||||
from app.model_handler.base_handler import (
|
||||
from src.core.base_handler import (
|
||||
Message,
|
||||
ChatMessage,
|
||||
Choice,
|
||||
ChatCompletionResponse,
|
||||
ArchBaseHandler,
|
||||
)
|
||||
from app.function_calling.hallucination_handler import HallucinationStateHandler
|
||||
|
||||
|
||||
SUPPORT_DATA_TYPES = ["int", "float", "bool", "str", "list", "tuple", "set", "dict"]
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
import time
|
||||
import torch
|
||||
import numpy as np
|
||||
import app.commons.utilities as utils
|
||||
import src.commons.utilities as utils
|
||||
|
||||
from pydantic import BaseModel
|
||||
from transformers import AutoTokenizer, AutoModelForSequenceClassification
|
||||
|
|
@ -1,7 +1,8 @@
|
|||
import math
|
||||
import torch
|
||||
from typing import Dict, List, Tuple
|
||||
import itertools
|
||||
|
||||
from typing import Dict, List, Tuple
|
||||
from enum import Enum
|
||||
|
||||
# constants
|
||||
|
|
@ -1,8 +1,8 @@
|
|||
import os
|
||||
|
||||
from app.commons.globals import handler_map
|
||||
from app.model_handler.base_handler import ChatMessage
|
||||
from app.model_handler.guardrails import GuardRequest
|
||||
from src.commons.globals import handler_map
|
||||
from src.core.base_handler import ChatMessage
|
||||
from src.core.guardrails import GuardRequest
|
||||
|
||||
from fastapi import FastAPI, Response
|
||||
from opentelemetry import trace
|
||||
|
|
@ -3,8 +3,8 @@ import pytest
|
|||
|
||||
from fastapi import Response
|
||||
from unittest.mock import AsyncMock, MagicMock, patch
|
||||
from app.commons.globals import handler_map
|
||||
from app.model_handler.base_handler import (
|
||||
from src.commons.globals import handler_map
|
||||
from src.core.base_handler import (
|
||||
Message,
|
||||
ChatMessage,
|
||||
ChatCompletionResponse,
|
||||
|
|
@ -1,5 +1,5 @@
|
|||
from unittest.mock import patch, MagicMock
|
||||
from app.model_handler.guardrails import get_guardrail_handler
|
||||
from src.core.guardrails import get_guardrail_handler
|
||||
|
||||
# Mock constants
|
||||
arch_guard_model_type = {
|
||||
|
|
@ -3,7 +3,7 @@ import pytest
|
|||
import os
|
||||
|
||||
|
||||
from app.model_handler.hallucination_handler import HallucinationStateHandler
|
||||
from src.core.hallucination_handler import HallucinationStateHandler
|
||||
|
||||
|
||||
# Get the directory of the current file
|
||||
|
|
@ -1,5 +1,5 @@
|
|||
from app.commons.globals import handler_map
|
||||
from app.model_handler.function_calling import Message
|
||||
from src.commons.globals import handler_map
|
||||
from src.core.function_calling import Message
|
||||
|
||||
|
||||
test_input_history = [
|
||||
|
|
@ -2,7 +2,7 @@ import pytest
|
|||
import httpx
|
||||
|
||||
from fastapi.testclient import TestClient
|
||||
from app.main import app
|
||||
from src.main import app
|
||||
|
||||
|
||||
client = TestClient(app)
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
import unittest
|
||||
|
||||
from unittest.mock import patch, MagicMock
|
||||
from app.cli import kill_process
|
||||
from src.cli import kill_process
|
||||
|
||||
|
||||
class TestStopServer(unittest.TestCase):
|
||||
Loading…
Add table
Add a link
Reference in a new issue