patch fastapi-offline to use local swagger-ui assests
This commit is contained in:
parent
b733a47902
commit
18e7e7307b
|
|
@ -6,7 +6,7 @@ sys.path.append(os.path.dirname(os.path.dirname(__file__)))
|
|||
from configs.model_config import NLTK_DATA_PATH, OPEN_CROSS_DOMAIN
|
||||
import argparse
|
||||
import uvicorn
|
||||
from fastapi_offline import FastAPIOffline as FastAPI
|
||||
from server.utils import FastAPIOffline as FastAPI
|
||||
from fastapi.middleware.cors import CORSMiddleware
|
||||
from starlette.responses import RedirectResponse
|
||||
from server.chat import (chat, knowledge_base_chat, openai_chat,
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
|
@ -2,6 +2,14 @@ import pydantic
|
|||
from pydantic import BaseModel
|
||||
from typing import List
|
||||
import torch
|
||||
from fastapi_offline import FastAPIOffline
|
||||
import fastapi_offline
|
||||
from pathlib import Path
|
||||
|
||||
|
||||
# patch fastapi_offline to use local static assests
|
||||
fastapi_offline.core._STATIC_PATH = Path(__file__).parent / "static"
|
||||
|
||||
|
||||
class BaseResponse(BaseModel):
|
||||
code: int = pydantic.Field(200, description="HTTP status code")
|
||||
|
|
|
|||
Loading…
Reference in New Issue