Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -18,7 +18,7 @@ def generate_pred(text):
|
|
18 |
with torch.no_grad():
|
19 |
# generate
|
20 |
text=f"<s>[INST]<<SYS>>\nBelow is an instruction that describes a task. Write a response that appropriately completes the request.\n<</SYS>>\n{text}[/INST]"
|
21 |
-
inputs = tokenizer(text, return_tensors="pt")
|
22 |
outputs = model.generate(input_ids=inputs["input_ids"],
|
23 |
attention_mask=inputs["attention_mask"],
|
24 |
max_new_tokens=1024,
|
|
|
18 |
with torch.no_grad():
|
19 |
# generate
|
20 |
text=f"<s>[INST]<<SYS>>\nBelow is an instruction that describes a task. Write a response that appropriately completes the request.\n<</SYS>>\n{text}[/INST]"
|
21 |
+
inputs = tokenizer(text, return_tensors="pt") #.to("cuda")
|
22 |
outputs = model.generate(input_ids=inputs["input_ids"],
|
23 |
attention_mask=inputs["attention_mask"],
|
24 |
max_new_tokens=1024,
|