Update README.md
Browse files
README.md
CHANGED
@@ -10,4 +10,31 @@ base_model:
|
|
10 |
- openai-community/gpt2
|
11 |
- openai-community/gpt2-medium
|
12 |
pipeline_tag: text-generation
|
13 |
-
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
10 |
- openai-community/gpt2
|
11 |
- openai-community/gpt2-medium
|
12 |
pipeline_tag: text-generation
|
13 |
+
---
|
14 |
+
|
15 |
+
# GPT-2 Medium Catalan-English Model
|
16 |
+
|
17 |
+
## Model Overview
|
18 |
+
This model is a GPT-2 Medium architecture trained **from scratch**, meaning it does not inherit any weights from existing models. It has been trained using **Catalan and English** datasets, specifically **ELiRF/dacsa** and **projecte-aina/CATalog**.
|
19 |
+
|
20 |
+
## License and Usage
|
21 |
+
This model is **free to use** under the MIT license. However, proper credit must be given when using it in research, applications, or any derived work.
|
22 |
+
|
23 |
+
## Tokenizer
|
24 |
+
The model utilizes a **52,000-token vocabulary**, specifically trained to handle both Catalan and English efficiently. The tokenizer was designed and implemented by **Marc Hurtado**.
|
25 |
+
|
26 |
+
## How to Use
|
27 |
+
To use this model for text generation, you can load it with the `transformers` library as follows:
|
28 |
+
|
29 |
+
```python
|
30 |
+
from transformers import AutoModelForCausalLM, AutoTokenizer
|
31 |
+
|
32 |
+
model_name = "your-username/test_gpt2_catalan"
|
33 |
+
model = AutoModelForCausalLM.from_pretrained(model_name)
|
34 |
+
tokenizer = AutoTokenizer.from_pretrained(model_name)
|
35 |
+
|
36 |
+
text = "Hola, com estàs?"
|
37 |
+
inputs = tokenizer(text, return_tensors="pt")
|
38 |
+
outputs = model.generate(**inputs)
|
39 |
+
|
40 |
+
print(tokenizer.decode(outputs[0], skip_special_tokens=True))
|