diff --git a/private_gpt/home.py b/private_gpt/home.py index d6298ccd..ad377de1 100644 --- a/private_gpt/home.py +++ b/private_gpt/home.py @@ -33,7 +33,7 @@ AVATAR_BOT = THIS_DIRECTORY_RELATIVE / "avatar-bot.ico" UI_TAB_TITLE = "My Private GPT" -SOURCES_SEPARATOR = "\n\n Sources: \n" +SOURCES_SEPARATOR = "\n Sources: \n" MODES = ["Query Docs", "Search in Docs", "LLM Chat"] home_router = APIRouter(prefix="/v1") @@ -70,7 +70,7 @@ class Home: if completion_gen.sources: full_response += SOURCES_SEPARATOR cur_sources = Source.curate_sources(completion_gen.sources) - sources_text = "\n\n\n".join( + sources_text = "\n".join( f'{index}. {source.file} (page {source.page})' for index, source in enumerate(cur_sources, start=1) ) @@ -123,7 +123,7 @@ class Home: sources = Source.curate_sources(response) - yield "\n\n\n".join( + yield "\n".join( f"{index}. **{source.file} (page {source.page})**\n" f" (link: [{source.page_link}]({source.page_link}))\n{source.text}" for index, source in enumerate(sources, start=1) diff --git a/private_gpt/launcher.py b/private_gpt/launcher.py index 64a31c11..67dda0be 100644 --- a/private_gpt/launcher.py +++ b/private_gpt/launcher.py @@ -40,7 +40,7 @@ def create_app(root_injector: Injector) -> FastAPI: app.add_middleware( CORSMiddleware, allow_credentials=True, - allow_origins=["http://localhost:80", "http://10.1.101.125", "http://quickgpt.gibl.com.np"], + allow_origins=["http://localhost:80", "http://10.1.101.125:80", "http://quickgpt.gibl.com.np:80", "http://10.1.101.125", "http://quickgpt.gibl.com.np"], allow_methods=["DELETE", "GET", "POST", "PUT", "OPTIONS", "PATCH"], allow_headers=["*"], )