Spaces:
Sleeping
Sleeping
ashutoshzade
commited on
Commit
•
143ff02
1
Parent(s):
96b5dba
Create app.py
Browse files
app.py
ADDED
@@ -0,0 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
from transformers import AutoTokenizer, AutoModelForCausalLM
|
2 |
+
|
3 |
+
tokenizer = AutoTokenizer.from_pretrained("google/gemma-2b")
|
4 |
+
model = AutoModelForCausalLM.from_pretrained("google/gemma-2b")
|
5 |
+
|
6 |
+
input_text = "Write me a poem about Machine Learning."
|
7 |
+
input_ids = tokenizer(input_text, return_tensors="pt")
|
8 |
+
|
9 |
+
outputs = model.generate(**input_ids)
|
10 |
+
print(tokenizer.decode(outputs[0]))
|