spikecodes
commited on
Commit
•
1277545
1
Parent(s):
e703839
Update README.md
Browse files
README.md
CHANGED
@@ -60,6 +60,16 @@ model = PeftModel.from_pretrained(model, LORA_CHECKPOINT)
|
|
60 |
model.to(torch.device("xpu" if torch.xpu.is_available() else "cpu"))
|
61 |
```
|
62 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
63 |
## Training Details
|
64 |
|
65 |
### Training Data
|
|
|
60 |
model.to(torch.device("xpu" if torch.xpu.is_available() else "cpu"))
|
61 |
```
|
62 |
|
63 |
+
Then, you can generate 911 operator responses by providing an input prompt:
|
64 |
+
|
65 |
+
```python
|
66 |
+
prompt = "911 Operator: 9-1-1, what's your emergency?\nCaller: There's a fire in my kitchen!\n911 Operator:"
|
67 |
+
inputs = tokenizer(prompt, return_tensors="pt").to(model.device)
|
68 |
+
outputs = model.generate(**inputs, max_new_tokens=100)
|
69 |
+
response = tokenizer.decode(outputs[0], skip_special_tokens=True)
|
70 |
+
print(response)
|
71 |
+
``
|
72 |
+
|
73 |
## Training Details
|
74 |
|
75 |
### Training Data
|