Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -13,6 +13,7 @@ from transformers import TextIteratorStreamer
|
|
13 |
from threading import Thread
|
14 |
|
15 |
torch.set_num_threads(2)
|
|
|
16 |
|
17 |
|
18 |
# OBTENER EL DATASET________________________________________________________________________________
|
@@ -368,8 +369,8 @@ if __name__ == '__main__':
|
|
368 |
bnb_4bit_compute_dtype=torch.bfloat16
|
369 |
)
|
370 |
|
371 |
-
tokenizer = AutoTokenizer.from_pretrained("google/gemma-2b-it")
|
372 |
-
model = AutoModelForCausalLM.from_pretrained("google/gemma-2b-it", quantization_config=quantization_config, torch_dtype=torch.float16, low_cpu_mem_usage=True)
|
373 |
|
374 |
|
375 |
def make_inference(query, hist):
|
|
|
13 |
from threading import Thread
|
14 |
|
15 |
torch.set_num_threads(2)
|
16 |
+
HF_TOKEN = os.environ.get("SECRET_TOKEN")
|
17 |
|
18 |
|
19 |
# OBTENER EL DATASET________________________________________________________________________________
|
|
|
369 |
bnb_4bit_compute_dtype=torch.bfloat16
|
370 |
)
|
371 |
|
372 |
+
tokenizer = AutoTokenizer.from_pretrained("google/gemma-2b-it", use_auth_token=HF_TOKEN)
|
373 |
+
model = AutoModelForCausalLM.from_pretrained("google/gemma-2b-it", quantization_config=quantization_config, torch_dtype=torch.float16, low_cpu_mem_usage=True, use_auth_token=HF_TOKEN)
|
374 |
|
375 |
|
376 |
def make_inference(query, hist):
|