FlipTip commited on
Commit
e3cfc57
1 Parent(s): 042471e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -7
app.py CHANGED
@@ -3,17 +3,15 @@ from transformers import AutoModelForCausalLM, AutoTokenizer
3
  import numpy as np
4
  import gradio as gr
5
  import spaces
6
- import accelerate
7
 
 
8
  model = AutoModelForCausalLM.from_pretrained(
9
- "microsoft/Phi-3-mini-4k-instruct",
10
- device_map="cuda",
11
- torch_dtype="auto",
12
- trust_remote_code=True,
13
  )
14
 
15
- tokenizer = AutoTokenizer.from_pretrained("microsoft/Phi-3-mini-4k-instruct")
16
-
17
  print("Loading finished.")
18
 
19
  print(f"Is CUDA available: {torch.cuda.is_available()}")
 
3
  import numpy as np
4
  import gradio as gr
5
  import spaces
6
+ model_name = "Writer/camel-5b-hf"
7
 
8
+ tokenizer = AutoTokenizer.from_pretrained(model_name)
9
  model = AutoModelForCausalLM.from_pretrained(
10
+ model_name,
11
+ device_map="auto",
12
+ torch_dtype=torch.float16
 
13
  )
14
 
 
 
15
  print("Loading finished.")
16
 
17
  print(f"Is CUDA available: {torch.cuda.is_available()}")