jaydatech commited on
Commit
060b916
·
verified ·
1 Parent(s): afd65a7

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -7
app.py CHANGED
@@ -37,23 +37,24 @@ device = "cuda" if torch.cuda.is_available() else "cpu"
37
 
38
  #tokenizer = AutoTokenizer.from_pretrained("microsoft/Phi-3-mini-4k-instruct")
39
  tokenizer = AutoTokenizer.from_pretrained(
40
- "microsoft/Phi-3-mini-4k-instruct",
41
  trust_remote_code=True,
42
  use_auth_token=HF_TOKEN
43
  )
44
 
 
 
 
 
 
 
 
45
  # model = AutoModelForCausalLM.from_pretrained(
46
  # REPO_NAME,
47
  # use_auth_token=HF_TOKEN,
48
  # torch_dtype=torch.float16 if torch.cuda.is_available() else torch.float32,
49
  # device_map="auto"
50
  # )
51
- model = AutoModelForCausalLM.from_pretrained(
52
- REPO_NAME,
53
- use_auth_token=HF_TOKEN,
54
- torch_dtype=torch.float16 if torch.cuda.is_available() else torch.float32,
55
- device_map="auto"
56
- )
57
 
58
  # Message and request models
59
  class ChatMessage(BaseModel):
 
37
 
38
  #tokenizer = AutoTokenizer.from_pretrained("microsoft/Phi-3-mini-4k-instruct")
39
  tokenizer = AutoTokenizer.from_pretrained(
40
+ REPO_NAME,
41
  trust_remote_code=True,
42
  use_auth_token=HF_TOKEN
43
  )
44
 
45
+ model = AutoModelForCausalLM.from_pretrained(
46
+ REPO_NAME,
47
+ use_auth_token=HF_TOKEN,
48
+ torch_dtype=torch.float16 if torch.cuda.is_available() else torch.float32,
49
+ device_map="auto",
50
+ trust_remote_code=True
51
+ )
52
  # model = AutoModelForCausalLM.from_pretrained(
53
  # REPO_NAME,
54
  # use_auth_token=HF_TOKEN,
55
  # torch_dtype=torch.float16 if torch.cuda.is_available() else torch.float32,
56
  # device_map="auto"
57
  # )
 
 
 
 
 
 
58
 
59
  # Message and request models
60
  class ChatMessage(BaseModel):