MOHAMMED AMEEN
commited on
Commit
ยท
eb219fa
1
Parent(s):
e4739ba
Add Gemma 3 12B Claude reasoning Gradio app
Browse files- app.py +19 -0
- requirements.txt +3 -0
app.py
ADDED
@@ -0,0 +1,19 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import gradio as gr
|
2 |
+
from transformers import AutoModelForCausalLM, AutoTokenizer
|
3 |
+
import torch
|
4 |
+
|
5 |
+
model_name = "reedmayhew/claude-3.7-sonnet-reasoning-gemma3-12B"
|
6 |
+
|
7 |
+
# ุชุญู
ูู ุงูุชููููุฒุฑ ูุงูู
ูุฏูู
|
8 |
+
tokenizer = AutoTokenizer.from_pretrained(model_name)
|
9 |
+
model = AutoModelForCausalLM.from_pretrained(model_name, torch_dtype=torch.float16).to("cuda")
|
10 |
+
|
11 |
+
def generate_text(prompt):
|
12 |
+
inputs = tokenizer(prompt, return_tensors="pt").to("cuda")
|
13 |
+
outputs = model.generate(**inputs, max_new_tokens=100)
|
14 |
+
return tokenizer.decode(outputs[0], skip_special_tokens=True)
|
15 |
+
|
16 |
+
iface = gr.Interface(fn=generate_text, inputs="text", outputs="text", title="Gemma 3 12B Claude Reasoning")
|
17 |
+
|
18 |
+
if __name__ == "__main__":
|
19 |
+
iface.launch()
|
requirements.txt
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
transformers
|
2 |
+
torch
|
3 |
+
gradio
|