amusktweewt
commited on
Commit
•
13a70d4
1
Parent(s):
467821a
Create README.md
Browse files
README.md
ADDED
@@ -0,0 +1,70 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
pipeline_tag: text-generation
|
3 |
+
---
|
4 |
+
|
5 |
+
# Model Card for Model ID
|
6 |
+
|
7 |
+
Small testing version of my first model
|
8 |
+
|
9 |
+
This modelcard aims to be a base template for new models. It has been generated using [this raw template](https://github.com/huggingface/huggingface_hub/blob/main/src/huggingface_hub/templates/modelcard_template.md?plain=1).
|
10 |
+
|
11 |
+
## Model Details
|
12 |
+
|
13 |
+
### Model Description
|
14 |
+
|
15 |
+
Test version of my first model
|
16 |
+
|
17 |
+
|
18 |
+
|
19 |
+
## Uses
|
20 |
+
|
21 |
+
Dosen't work well
|
22 |
+
|
23 |
+
|
24 |
+
### Out-of-Scope Use
|
25 |
+
|
26 |
+
Better not use for anything
|
27 |
+
|
28 |
+
[More Information Needed]
|
29 |
+
|
30 |
+
## Bias, Risks, and Limitations
|
31 |
+
|
32 |
+
Don't work
|
33 |
+
|
34 |
+
|
35 |
+
## How to Get Started with the Model
|
36 |
+
|
37 |
+
'''import torch
|
38 |
+
from transformers import AutoTokenizer, AutoModelForCausalLM
|
39 |
+
|
40 |
+
# Load pre-trained model tokenizer (v3 compatibility)
|
41 |
+
tokenizer = AutoTokenizer.from_pretrained("amusktweewt/checkpoint-72")
|
42 |
+
|
43 |
+
# Load pre-trained model (PyTorch Lightning module)
|
44 |
+
model = AutoModelForCausalLM.from_pretrained("amusktweewt/checkpoint-72")
|
45 |
+
|
46 |
+
# Set device
|
47 |
+
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
|
48 |
+
model.to(device)
|
49 |
+
|
50 |
+
while True:
|
51 |
+
user_input = input("> ")
|
52 |
+
if user_input.lower() == "quit":
|
53 |
+
break
|
54 |
+
|
55 |
+
inputs = tokenizer(user_input, return_tensors="pt", max_length=512, truncation=True).to(device)
|
56 |
+
outputs = model(**inputs)
|
57 |
+
|
58 |
+
logits = outputs.logits
|
59 |
+
probs = torch.nn.functional.softmax(logits, dim=-1)
|
60 |
+
top_prob, top_idx = torch.topk(probs, 3) # Get the top 3 probabilities
|
61 |
+
|
62 |
+
# Flatten the list of token IDs before decoding
|
63 |
+
top_idx = top_idx[0].view(-1).tolist()
|
64 |
+
top_pred = tokenizer.decode(top_idx, skip_special_tokens=True)
|
65 |
+
|
66 |
+
print(f"You: {user_input}")
|
67 |
+
print(f"Model: {top_pred}")
|
68 |
+
|
69 |
+
print("Goodbye!")
|
70 |
+
'''
|