Spaces:
Runtime error
Runtime error
zetavg
commited on
load base model on start
Browse files
app.py
CHANGED
|
@@ -7,6 +7,7 @@ import gradio as gr
|
|
| 7 |
from llama_lora.globals import Global
|
| 8 |
from llama_lora.ui.main_page import main_page, get_page_title, main_page_custom_css
|
| 9 |
from llama_lora.utils.data import init_data_dir
|
|
|
|
| 10 |
|
| 11 |
|
| 12 |
def main(
|
|
@@ -16,6 +17,7 @@ def main(
|
|
| 16 |
# Allows to listen on all interfaces by providing '0.0.0.0'.
|
| 17 |
server_name: str = "127.0.0.1",
|
| 18 |
share: bool = False,
|
|
|
|
| 19 |
ui_show_sys_info: bool = True,
|
| 20 |
ui_dev_mode: bool = False,
|
| 21 |
):
|
|
@@ -39,6 +41,9 @@ def main(
|
|
| 39 |
os.makedirs(data_dir, exist_ok=True)
|
| 40 |
init_data_dir()
|
| 41 |
|
|
|
|
|
|
|
|
|
|
| 42 |
with gr.Blocks(title=get_page_title(), css=main_page_custom_css()) as demo:
|
| 43 |
main_page()
|
| 44 |
|
|
|
|
| 7 |
from llama_lora.globals import Global
|
| 8 |
from llama_lora.ui.main_page import main_page, get_page_title, main_page_custom_css
|
| 9 |
from llama_lora.utils.data import init_data_dir
|
| 10 |
+
from llama_lora.models import load_base_model
|
| 11 |
|
| 12 |
|
| 13 |
def main(
|
|
|
|
| 17 |
# Allows to listen on all interfaces by providing '0.0.0.0'.
|
| 18 |
server_name: str = "127.0.0.1",
|
| 19 |
share: bool = False,
|
| 20 |
+
skip_loading_base_model: bool = False,
|
| 21 |
ui_show_sys_info: bool = True,
|
| 22 |
ui_dev_mode: bool = False,
|
| 23 |
):
|
|
|
|
| 41 |
os.makedirs(data_dir, exist_ok=True)
|
| 42 |
init_data_dir()
|
| 43 |
|
| 44 |
+
if not skip_loading_base_model:
|
| 45 |
+
load_base_model()
|
| 46 |
+
|
| 47 |
with gr.Blocks(title=get_page_title(), css=main_page_custom_css()) as demo:
|
| 48 |
main_page()
|
| 49 |
|