crodri commited on
Commit
4a641c6
1 Parent(s): 80a7210

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +18 -22
README.md CHANGED
@@ -92,7 +92,8 @@ widget:
92
 
93
  **Ǎguila-7B** is a transformer-based causal language model for Catalan, Spanish, and English.
94
  It is based on the [Falcon-7B](https://huggingface.co/tiiuae/falcon-7b) model and has been trained on a 26B token
95
- trilingual corpus collected from publicly available corpora and crawlers.
 
96
 
97
 
98
  ## Intended uses and limitations
@@ -105,29 +106,24 @@ However, it is intended to be fine-tuned for downstream tasks.
105
  Here is how to use this model:
106
 
107
  ```python
108
- import torch
109
- from transformers import pipeline, AutoTokenizer, AutoModelForCausalLM
110
-
111
- input_text = "El mercat del barri és fantàstic, hi pots trobar"
112
-
113
- model_id = "projecte-aina/aguila-7b"
114
- tokenizer = AutoTokenizer.from_pretrained(model_id)
115
- generator = pipeline(
116
- "text-generation",
117
- model=model_id,
118
- tokenizer=tokenizer,
119
- torch_dtype=torch.bfloat16,
120
- trust_remote_code=True,
121
- device_map="auto",
122
  )
123
- generation = generator(
124
- input_text,
125
- do_sample=True,
126
- top_k=10,
127
- eos_token_id=tokenizer.eos_token_id,
128
  )
129
-
130
- print(f"Result: {generation[0]['generated_text']}")
131
  ```
132
 
133
  ## Limitations and bias
 
92
 
93
  **Ǎguila-7B** is a transformer-based causal language model for Catalan, Spanish, and English.
94
  It is based on the [Falcon-7B](https://huggingface.co/tiiuae/falcon-7b) model and has been trained on a 26B token
95
+ trilingual corpus collected from publicly available corpora and crawlers. This is a quantized version using ct2-transformers-converter,
96
+ as in [michaelfeil/ct2fast-falcon-7b] (https://huggingface.co/michaelfeil/ct2fast-falcon-7b)
97
 
98
 
99
  ## Intended uses and limitations
 
106
  Here is how to use this model:
107
 
108
  ```python
109
+ from hf_hub_ctranslate2 import TranslatorCT2fromHfHub, GeneratorCT2fromHfHub
110
+ from transformers import AutoTokenizer
111
+
112
+ model_name = "crodri/aguila_quantized"
113
+ # use either TranslatorCT2fromHfHub or GeneratorCT2fromHfHub here, depending on model.
114
+ model = GeneratorCT2fromHfHub(
115
+ # load in int8 on CUDA
116
+ model_name_or_path=model_name,
117
+ device="cuda",
118
+ compute_type="int8_float16",
119
+ # tokenizer=AutoTokenizer.from_pretrained("tiiuae/falcon-7b")
 
 
 
120
  )
121
+ outputs = model.generate(
122
+ text=["El millor de Barcelona es "],
123
+ max_length=512,
124
+ include_prompt_in_result=False
 
125
  )
126
+ print(outputs)
 
127
  ```
128
 
129
  ## Limitations and bias