Update app.py
Browse files
app.py
CHANGED
@@ -19,7 +19,11 @@ base_model_id = "codellama/CodeLlama-7b-hf"
|
|
19 |
dataset = "gretelai/synthetic_text_to_sql"
|
20 |
|
21 |
def prompt_model(model_id, system_prompt, user_prompt, schema):
|
22 |
-
pipe = pipeline("text-generation",
|
|
|
|
|
|
|
|
|
23 |
messages = [
|
24 |
{"role": "system", "content": system_prompt.format(schema=schema)},
|
25 |
{"role": "user", "content": user_prompt},
|
|
|
19 |
dataset = "gretelai/synthetic_text_to_sql"
|
20 |
|
21 |
def prompt_model(model_id, system_prompt, user_prompt, schema):
|
22 |
+
pipe = pipeline("text-generation",
|
23 |
+
model=model_id,
|
24 |
+
model_kwargs={"torch_dtype": torch.bfloat16},
|
25 |
+
device_map="auto",
|
26 |
+
max_new_tokens=1000)
|
27 |
messages = [
|
28 |
{"role": "system", "content": system_prompt.format(schema=schema)},
|
29 |
{"role": "user", "content": user_prompt},
|