Spaces:
Sleeping
Sleeping
eronariodito
commited on
Update app.py
Browse files
app.py
CHANGED
@@ -1,11 +1,9 @@
|
|
1 |
import gradio as gr
|
2 |
-
|
3 |
-
import
|
4 |
|
5 |
-
|
6 |
-
|
7 |
-
tokenizer = AutoTokenizer.from_pretrained(model_name)
|
8 |
-
model = AutoModelForCausalLM.from_pretrained(model_name)
|
9 |
|
10 |
# Move the model to the appropriate device (GPU if available, else CPU)
|
11 |
device = "cuda" if torch.cuda.is_available() else "cpu"
|
|
|
1 |
import gradio as gr
|
2 |
+
# Load model directly
|
3 |
+
from transformers import AutoTokenizer, AutoModelForCausalLM
|
4 |
|
5 |
+
tokenizer = AutoTokenizer.from_pretrained("unsloth/gemma-7b-bnb-4bit")
|
6 |
+
model = AutoModelForCausalLM.from_pretrained("unsloth/gemma-7b-bnb-4bit")
|
|
|
|
|
7 |
|
8 |
# Move the model to the appropriate device (GPU if available, else CPU)
|
9 |
device = "cuda" if torch.cuda.is_available() else "cpu"
|