Update app.py
Browse files
app.py
CHANGED
@@ -26,7 +26,7 @@ def process(action, base_model_name, ft_model_name, dataset_name, system_prompt,
|
|
26 |
result = prompt_model(ft_model_name, system_prompt, user_prompt, sql_schema)
|
27 |
return result
|
28 |
|
29 |
-
def fine_tune_model(
|
30 |
# Load dataset
|
31 |
dataset = load_dataset(dataset_name)
|
32 |
|
@@ -35,7 +35,7 @@ def fine_tune_model(model_name, dataset_name):
|
|
35 |
print("###")
|
36 |
|
37 |
# Load model
|
38 |
-
model, tokenizer = load_model(
|
39 |
|
40 |
print("### Model")
|
41 |
print(model)
|
@@ -128,7 +128,7 @@ def prompt_model(model_name, system_prompt, user_prompt, sql_schema):
|
|
128 |
|
129 |
def load_model(model_name):
|
130 |
model = AutoModelForCausalLM.from_pretrained(model_name, device_map="auto")
|
131 |
-
tokenizer = AutoTokenizer.from_pretrained(
|
132 |
|
133 |
return model, tokenizer
|
134 |
|
|
|
26 |
result = prompt_model(ft_model_name, system_prompt, user_prompt, sql_schema)
|
27 |
return result
|
28 |
|
29 |
+
def fine_tune_model(base_model_name, dataset_name):
|
30 |
# Load dataset
|
31 |
dataset = load_dataset(dataset_name)
|
32 |
|
|
|
35 |
print("###")
|
36 |
|
37 |
# Load model
|
38 |
+
model, tokenizer = load_model(base_model_name)
|
39 |
|
40 |
print("### Model")
|
41 |
print(model)
|
|
|
128 |
|
129 |
def load_model(model_name):
|
130 |
model = AutoModelForCausalLM.from_pretrained(model_name, device_map="auto")
|
131 |
+
tokenizer = AutoTokenizer.from_pretrained(model_name)
|
132 |
|
133 |
return model, tokenizer
|
134 |
|