bstraehle commited on
Commit
df9a90e
1 Parent(s): 3a9c101

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -3
app.py CHANGED
@@ -21,7 +21,7 @@ action_1 = "Prompt base model"
21
  action_2 = "Prompt fine-tuned model"
22
  action_3 = "Fine-tune base model"
23
 
24
- 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."
25
  user_prompt = "What is the total trade value and average price for each trader and stock in the trade_history table?"
26
 
27
  base_model_id = "meta-llama/Meta-Llama-3-8B-Instruct"
@@ -36,8 +36,10 @@ def prompt_model(model_id, system_prompt, user_prompt):
36
  {"role": "user", "content": user_prompt},
37
  {"role": "assistant", "content": ""}
38
  ]
39
-
40
- return pipe(messages)
 
 
41
 
42
  def fine_tune_model(model_id):
43
  tokenizer = download_model(model_id)
 
21
  action_2 = "Prompt fine-tuned model"
22
  action_3 = "Fine-tune base model"
23
 
24
+ system_prompt = "You are a text to SQL query translator. A user will ask you a question in English and you will generate a SQL query. Do not generate any additional text."
25
  user_prompt = "What is the total trade value and average price for each trader and stock in the trade_history table?"
26
 
27
  base_model_id = "meta-llama/Meta-Llama-3-8B-Instruct"
 
36
  {"role": "user", "content": user_prompt},
37
  {"role": "assistant", "content": ""}
38
  ]
39
+
40
+ outputs = pipe(messages)
41
+
42
+ return outputs[0]["generated_text"][-1]
43
 
44
  def fine_tune_model(model_id):
45
  tokenizer = download_model(model_id)