This commit is contained in:
Jerry Liu
2023-08-16 00:47:43 -07:00
parent 6fe9611480
commit 747fa7e592
2 changed files with 3 additions and 27 deletions
+3
View File
@@ -0,0 +1,3 @@
modal-client==0.50.3044
llama-index==0.8.2.post1
datasets==2.14.4
-27
View File
@@ -1,27 +0,0 @@
from typing import Optional
from pathlib import Path
from .common import VOL_MOUNT_PATH
def user_data_path(user: str, data_dir: str = "data_sql") -> Path:
return VOL_MOUNT_PATH / data_dir / user / "data_sql.jsonl"
def user_model_path(user: str, data_dir: str = "data_sql", checkpoint: Optional[str] = None) -> Path:
path = VOL_MOUNT_PATH / data_dir / user
if checkpoint:
path = path / checkpoint
return path
def generate_prompt_sql(user, input, context, output=""):
return f"""You are {user}, a powerful text-to-SQL model. Your job is to answer questions about a database. You are given a question and context regarding one or more tables.
You must output the SQL query that answers the question.
### Input:
{input}
### Context:
{context}
### Response:
{output}"""