Update app.py
Browse files
app.py
CHANGED
@@ -64,11 +64,11 @@ def prompt_model(model_id, system_prompt, user_prompt, schema):
|
|
64 |
# print(f"Generated Answer:\n{outputs[0]['generated_text'][len(prompt):].strip()}")
|
65 |
|
66 |
def fine_tune_model(base_model_id, dataset):
|
67 |
-
|
68 |
-
prepare_dataset(dataset)
|
69 |
-
train_model(base_model_id)
|
70 |
-
|
71 |
-
return
|
72 |
|
73 |
def download_model(base_model_id):
|
74 |
tokenizer = AutoTokenizer.from_pretrained(base_model_id)
|
@@ -211,7 +211,7 @@ def process(action, base_model_id, dataset, system_prompt, user_prompt, schema):
|
|
211 |
|
212 |
demo = gr.Interface(fn=process,
|
213 |
inputs=[gr.Radio([action_1, action_2], label = "Action", value = action_1),
|
214 |
-
gr.Textbox(label = "Base Model ID", value =
|
215 |
gr.Textbox(label = "Dataset", value = dataset, lines = 1),
|
216 |
gr.Textbox(label = "System Prompt", value = system_prompt, lines = 2),
|
217 |
gr.Textbox(label = "User Prompt", value = user_prompt, lines = 2),
|
|
|
64 |
# print(f"Generated Answer:\n{outputs[0]['generated_text'][len(prompt):].strip()}")
|
65 |
|
66 |
def fine_tune_model(base_model_id, dataset):
|
67 |
+
tokenizer = download_model(base_model_id)
|
68 |
+
#prepare_dataset(dataset)
|
69 |
+
#train_model(base_model_id)
|
70 |
+
fine_tuned_model_id = upload_model(base_model_id, tokenizer)
|
71 |
+
return fine_tuned_model_id
|
72 |
|
73 |
def download_model(base_model_id):
|
74 |
tokenizer = AutoTokenizer.from_pretrained(base_model_id)
|
|
|
211 |
|
212 |
demo = gr.Interface(fn=process,
|
213 |
inputs=[gr.Radio([action_1, action_2], label = "Action", value = action_1),
|
214 |
+
gr.Textbox(label = "Base Model ID", value = base_model_id, lines = 1),
|
215 |
gr.Textbox(label = "Dataset", value = dataset, lines = 1),
|
216 |
gr.Textbox(label = "System Prompt", value = system_prompt, lines = 2),
|
217 |
gr.Textbox(label = "User Prompt", value = user_prompt, lines = 2),
|