Spaces:
Runtime error
Runtime error
Commit
·
6e6ad02
1
Parent(s):
29d95b0
fix duplicated function
Browse files
app.py
CHANGED
@@ -15,18 +15,6 @@ tokenizer = AutoTokenizer.from_pretrained(config.base_model_name_or_path)
|
|
15 |
# Load the Lora model
|
16 |
model = PeftModel.from_pretrained(model, peft_model_id)
|
17 |
|
18 |
-
|
19 |
-
def make_inference(product_name, product_description):
|
20 |
-
batch = tokenizer(
|
21 |
-
f"### Product and Description:\n{product_name}: {product_description}\n\n### Ad:",
|
22 |
-
return_tensors="pt",
|
23 |
-
)
|
24 |
-
|
25 |
-
with torch.cuda.amp.autocast():
|
26 |
-
output_tokens = model.generate(**batch, max_new_tokens=50)
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
def make_inference(person, location, grammer, level):
|
31 |
|
32 |
batch = tokenizer(f"""
|
|
|
15 |
# Load the Lora model
|
16 |
model = PeftModel.from_pretrained(model, peft_model_id)
|
17 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
18 |
def make_inference(person, location, grammer, level):
|
19 |
|
20 |
batch = tokenizer(f"""
|