Update app.py
Browse files
app.py
CHANGED
@@ -1,8 +1,12 @@
|
|
1 |
-
|
2 |
-
from transformers import pipeline
|
3 |
|
4 |
-
|
5 |
-
|
6 |
-
|
7 |
-
|
8 |
-
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
from transformers import AutoModelForCausalLM, AutoTokenizer
|
|
|
2 |
|
3 |
+
# Load tokenizer and model manually
|
4 |
+
tokenizer = AutoTokenizer.from_pretrained("Omartificial-Intelligence-Space/Arabic-QWQ-32B-Preview")
|
5 |
+
model = AutoModelForCausalLM.from_pretrained("Omartificial-Intelligence-Space/Arabic-QWQ-32B-Preview")
|
6 |
+
|
7 |
+
# Manually perform text generation
|
8 |
+
inputs = tokenizer("Generate text example:", return_tensors="pt")
|
9 |
+
outputs = model.generate(**inputs, max_length=50)
|
10 |
+
|
11 |
+
# Decode the output
|
12 |
+
print(tokenizer.decode(outputs[0]))
|