Update README.md
Browse files
README.md
CHANGED
|
@@ -37,6 +37,21 @@ This is the model card of a 🤗 transformers model that has been pushed on the
|
|
| 37 |
Use the code below to get started with the model.
|
| 38 |
|
| 39 |
```
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 40 |
# Using passage (two sentences), char1 and char2 to classify the interaction type (No, Associating, Thinking, Touching, Observing, Communicating) for one datapoint.
|
| 41 |
example = {'book_name': '2013_O_Connell,Carol_ItHappensintheDark_MY',
|
| 42 |
'sentence_ID': 371,
|
|
|
|
| 37 |
Use the code below to get started with the model.
|
| 38 |
|
| 39 |
```
|
| 40 |
+
model = AutoModelForCausalLM.from_pretrained(
|
| 41 |
+
"ChunB1/Phi-3-interact",
|
| 42 |
+
torch_dtype="auto",
|
| 43 |
+
trust_remote_code=True,
|
| 44 |
+
attn_implementation="flash_attention_2",
|
| 45 |
+
)
|
| 46 |
+
model.to("cuda")
|
| 47 |
+
tokenizer = AutoTokenizer.from_pretrained("microsoft/Phi-3-small-8k-instruct")
|
| 48 |
+
|
| 49 |
+
pipe = pipeline(
|
| 50 |
+
"text-generation",
|
| 51 |
+
model=model,
|
| 52 |
+
tokenizer=tokenizer,
|
| 53 |
+
)
|
| 54 |
+
|
| 55 |
# Using passage (two sentences), char1 and char2 to classify the interaction type (No, Associating, Thinking, Touching, Observing, Communicating) for one datapoint.
|
| 56 |
example = {'book_name': '2013_O_Connell,Carol_ItHappensintheDark_MY',
|
| 57 |
'sentence_ID': 371,
|