Compare commits
No commits in common. "5c7ced30df28ebf34252c1adbe2a106eedcdf74e" and "67281fe06a07e7803d5d229d5ada7ac373d55174" have entirely different histories.
5c7ced30df
...
67281fe06a
@ -1,4 +1,5 @@
|
|||||||
import os
|
import os
|
||||||
|
import json
|
||||||
import sys
|
import sys
|
||||||
from typing import Optional
|
from typing import Optional
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
@ -41,15 +42,13 @@ def initialize_prompt_store(db: TinyDB) -> None:
|
|||||||
Args:
|
Args:
|
||||||
db (TinyDB): TinyDB数据库实例
|
db (TinyDB): TinyDB数据库实例
|
||||||
"""
|
"""
|
||||||
# 检查数据库是否为空
|
db.insert(promptTempleta(name="default",
|
||||||
if not db.all(): # 如果数据库中没有数据
|
description="默认提示词模板",
|
||||||
db.insert(promptTempleta(name="default",
|
content="""项目名为:{ project_name }
|
||||||
description="默认提示词模板",
|
|
||||||
content="""项目名为:{ project_name }
|
|
||||||
请依据以下该项目官方文档的部分内容,创造合适的对话数据集用于微调一个了解该项目的小模型的语料,要求兼顾文档中间尽可能多的信息点,使用中文
|
请依据以下该项目官方文档的部分内容,创造合适的对话数据集用于微调一个了解该项目的小模型的语料,要求兼顾文档中间尽可能多的信息点,使用中文
|
||||||
文档节选:{ content }
|
文档节选:{ content }
|
||||||
按照如下json格式返回:{ json }""").model_dump())
|
按照如下json格式返回:{ json }""").model_dump())
|
||||||
# 如果数据库中已有数据,则跳过插入
|
# TinyDB不需要显式创建表结构,首次使用时自动创建
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
|
@ -1,7 +1,9 @@
|
|||||||
import gradio as gr
|
import gradio as gr
|
||||||
from typing import List
|
from typing import List
|
||||||
from sqlmodel import Session, select
|
from sqlmodel import Session, select
|
||||||
|
from db import get_sqlite_engine
|
||||||
from schema import APIProvider
|
from schema import APIProvider
|
||||||
|
import os
|
||||||
from global_var import sql_engine
|
from global_var import sql_engine
|
||||||
|
|
||||||
def setting_page():
|
def setting_page():
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
from db import get_sqlite_engine,get_prompt_tinydb
|
from db import get_sqlite_engine
|
||||||
|
from db import get_prompt_tinydb
|
||||||
|
|
||||||
prompt_store = get_prompt_tinydb("workdir")
|
prompt_store = get_prompt_tinydb("workdir")
|
||||||
sql_engine = get_sqlite_engine("workdir")
|
sql_engine = get_sqlite_engine("workdir")
|
Loading…
x
Reference in New Issue
Block a user