From 0e58d0b6cd6e94ea0cc5de66d0c45f1205fe03b7 Mon Sep 17 00:00:00 2001 From: Arne Binder Date: Mon, 30 Oct 2023 16:49:06 +0100 Subject: [PATCH] fix templates file location --- frontend/app.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/frontend/app.py b/frontend/app.py index 205ba37..c795a0f 100644 --- a/frontend/app.py +++ b/frontend/app.py @@ -1,5 +1,6 @@ import json from functools import partial +from pathlib import Path from typing import List, Tuple, Dict, Iterator, Union import gradio as gr @@ -31,6 +32,7 @@ "watermark": False, "decoder_input_details": False, } +TEMPLATES_FILE = Path(__file__).parent / "templates.json" DEFAULT_TEMPLATE = "upstage/SOLAR-0-70b-16bit" @@ -113,7 +115,7 @@ def update_template_and_system_prior(template_key, template_str, system_prior, t def start(): # load templates from json file - templates = json.load(open("templates.json")) + templates = json.load(open(TEMPLATES_FILE)) # endpoint with info endpoint = gr.Textbox(lines=1, label="Address", value=DEFAULT_API_ENDPOINT) endpoint_info = gr.JSON(label="Endpoint info")