Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -5,12 +5,12 @@ from transformers import AutoModelForCausalLM
|
|
5 |
from transformers import AutoTokenizer
|
6 |
|
7 |
model_name = "thfname/test-gemma2-2b"
|
8 |
-
model = AutoModelForCausalLM.from_pretrained(model_name, torch_dtype=torch.bfloat16)
|
9 |
tokenizer = AutoTokenizer.from_pretrained(model_name)
|
10 |
|
11 |
|
12 |
def gt (tx):
|
13 |
-
input_ids = tokenizer(tx, return_tensors="pt")
|
14 |
outputs = model.generate(**input_ids, max_new_tokens=32)
|
15 |
return tokenizer.decode(outputs[0])
|
16 |
|
|
|
5 |
from transformers import AutoTokenizer
|
6 |
|
7 |
model_name = "thfname/test-gemma2-2b"
|
8 |
+
model = AutoModelForCausalLM.from_pretrained(model_name, torch_dtype=torch.bfloat16)
|
9 |
tokenizer = AutoTokenizer.from_pretrained(model_name)
|
10 |
|
11 |
|
12 |
def gt (tx):
|
13 |
+
input_ids = tokenizer(tx, return_tensors="pt")
|
14 |
outputs = model.generate(**input_ids, max_new_tokens=32)
|
15 |
return tokenizer.decode(outputs[0])
|
16 |
|