Update app.py
Browse files
app.py
CHANGED
@@ -48,14 +48,29 @@ def upload_model(model_id, tokenizer):
|
|
48 |
|
49 |
return model_repo_name
|
50 |
|
51 |
-
def process(model_id, dataset):
|
52 |
-
|
53 |
-
|
|
|
|
|
|
|
|
|
54 |
|
55 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
56 |
|
57 |
demo = gr.Interface(fn=process,
|
58 |
-
inputs=[gr.
|
59 |
-
gr.Textbox(label = "
|
|
|
|
|
|
|
60 |
outputs=[gr.Textbox(label = "Completion")])
|
61 |
demo.launch()
|
|
|
48 |
|
49 |
return model_repo_name
|
50 |
|
51 |
+
def process(action, system_prompt, user_prompt, model_id, dataset):
|
52 |
+
if action == "Prompt base model":
|
53 |
+
result = "Prompt base model"
|
54 |
+
elif action == "Fine-tuned base model":
|
55 |
+
result = "Fine-tuned base model"
|
56 |
+
elif action == "Prompt fine-tuned model":
|
57 |
+
result = "Prompt fine-tuned model"
|
58 |
|
59 |
+
#tokenizer = download_model(model_id)
|
60 |
+
#model_repo_name = upload_model(model_id, tokenizer)
|
61 |
+
|
62 |
+
return result
|
63 |
+
|
64 |
+
system_prompt = "You are a text to SQL query translator. Users will ask you a question in English and you will generate a SQL query."
|
65 |
+
user_prompt = "What is the total trade value and average price for each trader and stock in the trade_history table?"
|
66 |
+
model_id = "meta-llama/Meta-Llama-3-8B-Instruct"
|
67 |
+
dataset = "gretelai/synthetic_text_to_sql"
|
68 |
|
69 |
demo = gr.Interface(fn=process,
|
70 |
+
inputs=[gr.Radio(["Prompt base model", "Fine-tune base model", "Prompt fine-tuned model"], label = "Action")],
|
71 |
+
gr.Textbox(label = "System Prompt", value = system_prompt, lines = 1),
|
72 |
+
gr.Textbox(label = "User Prompt", value = user_prompt, lines = 1),
|
73 |
+
gr.Textbox(label = "Model ID", value = model_id, lines = 1),
|
74 |
+
gr.Textbox(label = "Dataset", value = dataset, lines = 1)],
|
75 |
outputs=[gr.Textbox(label = "Completion")])
|
76 |
demo.launch()
|