Update README.md
Browse files
README.md
CHANGED
|
@@ -1,6 +1,9 @@
|
|
| 1 |
---
|
| 2 |
base_model: openGPT-X/Teuken-7B-instruct-research-v0.4
|
| 3 |
library_name: peft
|
|
|
|
|
|
|
|
|
|
| 4 |
---
|
| 5 |
|
| 6 |
# Model Card for Model ID
|
|
@@ -41,6 +44,32 @@ library_name: peft
|
|
| 41 |
|
| 42 |
<!-- This section is for the model use without fine-tuning or plugging into a larger ecosystem/app. -->
|
| 43 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 44 |
[More Information Needed]
|
| 45 |
|
| 46 |
### Downstream Use [optional]
|
|
|
|
| 1 |
---
|
| 2 |
base_model: openGPT-X/Teuken-7B-instruct-research-v0.4
|
| 3 |
library_name: peft
|
| 4 |
+
license: mit
|
| 5 |
+
language:
|
| 6 |
+
- de
|
| 7 |
---
|
| 8 |
|
| 9 |
# Model Card for Model ID
|
|
|
|
| 44 |
|
| 45 |
<!-- This section is for the model use without fine-tuning or plugging into a larger ecosystem/app. -->
|
| 46 |
|
| 47 |
+
How to use the model:
|
| 48 |
+
|
| 49 |
+
from transformers import AutoModelForSequenceClassification, AutoTokenizer
|
| 50 |
+
import torch
|
| 51 |
+
|
| 52 |
+
tokenizer = AutoTokenizer.from_pretrained("openGPT-X/Teuken-7B-instruct-research-v0.4")
|
| 53 |
+
|
| 54 |
+
model = AutoModelForSequenceClassification.from_pretrained("MB55/teuken7b-advance-classifier")
|
| 55 |
+
|
| 56 |
+
model.eval()
|
| 57 |
+
|
| 58 |
+
def predict(text):
|
| 59 |
+
inputs = tokenizer(text, return_tensors="pt", truncation=True, padding=True)
|
| 60 |
+
if "token_type_ids" in inputs:
|
| 61 |
+
del inputs["token_type_ids"]
|
| 62 |
+
with torch.no_grad():
|
| 63 |
+
outputs = model(**inputs)
|
| 64 |
+
logits = outputs.logits
|
| 65 |
+
predicted_class = logits.argmax(dim=-1).item()
|
| 66 |
+
return predicted_class
|
| 67 |
+
|
| 68 |
+
text = "Ich bin da."
|
| 69 |
+
prediction = predict(text)
|
| 70 |
+
|
| 71 |
+
print(f"Predicted class: {prediction}")
|
| 72 |
+
|
| 73 |
[More Information Needed]
|
| 74 |
|
| 75 |
### Downstream Use [optional]
|