Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -15,7 +15,8 @@ tok = AutoTokenizer.from_pretrained("stabilityai/stablelm-2-zephyr-1_6b", trust_
|
|
15 |
device = torch.device('cuda' if torch.cuda.is_available() else 'cpu')
|
16 |
embedding_func=m.get_input_embeddings()
|
17 |
embedding_func.weight.requires_grad=False
|
18 |
-
|
|
|
19 |
sample_input = tok.apply_chat_template(chat, tokenize=False, add_generation_prompt=True)
|
20 |
input_start_id=sample_input.find(slot)
|
21 |
prefix=sample_input[:input_start_id]
|
|
|
15 |
device = torch.device('cuda' if torch.cuda.is_available() else 'cpu')
|
16 |
embedding_func=m.get_input_embeddings()
|
17 |
embedding_func.weight.requires_grad=False
|
18 |
+
slot="<slot_for_user_input_design_by_xm>"
|
19 |
+
chat=[{"role": "user", "content": slot}]
|
20 |
sample_input = tok.apply_chat_template(chat, tokenize=False, add_generation_prompt=True)
|
21 |
input_start_id=sample_input.find(slot)
|
22 |
prefix=sample_input[:input_start_id]
|