Spaces:
Runtime error
Runtime error
Ankitajadhav
commited on
Update app.py
Browse files
app.py
CHANGED
@@ -7,13 +7,20 @@ from sentence_transformers import SentenceTransformer
|
|
7 |
import chromadb
|
8 |
from datasets import load_dataset
|
9 |
import gradio as gr
|
10 |
-
|
11 |
|
12 |
# Load model directly
|
13 |
from transformers import AutoTokenizer, AutoModelForCausalLM
|
14 |
|
15 |
-
|
16 |
-
model = AutoModelForCausalLM.from_pretrained(
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
17 |
|
18 |
# Function to clear the cache
|
19 |
def clear_cache(model_name):
|
|
|
7 |
import chromadb
|
8 |
from datasets import load_dataset
|
9 |
import gradio as gr
|
10 |
+
|
11 |
|
12 |
# Load model directly
|
13 |
from transformers import AutoTokenizer, AutoModelForCausalLM
|
14 |
|
15 |
+
torch.random.manual_seed(0)
|
16 |
+
model = AutoModelForCausalLM.from_pretrained(
|
17 |
+
"microsoft/Phi-3-mini-4k-instruct",
|
18 |
+
device_map="cup",
|
19 |
+
torch_dtype="auto",
|
20 |
+
trust_remote_code=True,
|
21 |
+
)
|
22 |
+
|
23 |
+
tokenizer = AutoTokenizer.from_pretrained("microsoft/Phi-3-mini-4k-instruct")
|
24 |
|
25 |
# Function to clear the cache
|
26 |
def clear_cache(model_name):
|