Ankitajadhav commited on
Commit
8838db8
·
verified ·
1 Parent(s): 2ecc941

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +10 -3
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
- from transformers import GPT2Tokenizer, GPT2LMHeadModel, Trainer, TrainingArguments
11
 
12
  # Load model directly
13
  from transformers import AutoTokenizer, AutoModelForCausalLM
14
 
15
- tokenizer = AutoTokenizer.from_pretrained("umashankar00/Text_Generation_model")
16
- model = AutoModelForCausalLM.from_pretrained("umashankar00/Text_Generation_model")
 
 
 
 
 
 
 
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):