switiz87 commited on
Commit
d3e8302
1 Parent(s): 60abf4b

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -3
app.py CHANGED
@@ -6,6 +6,10 @@ import torch
6
  import spaces
7
  from transformers import AutoModelForCausalLM, AutoTokenizer, TextIteratorStreamer
8
 
 
 
 
 
9
  DESCRIPTION = """ EXAONE-3.0-7.8B-Instruct Official Demo \
10
  """
11
 
@@ -15,10 +19,9 @@ MAX_INPUT_TOKEN_LENGTH = int(os.getenv("MAX_INPUT_TOKEN_LENGTH", "3840"))
15
 
16
  device = torch.device("cuda:0" if torch.cuda.is_available() else "cpu")
17
 
18
- model_id = "LGAI-EXAONE/EXAONE-3.0-7.8B-Instruct"
19
- tokenizer = AutoTokenizer.from_pretrained(model_id)
20
  model = AutoModelForCausalLM.from_pretrained(
21
- model_id,
22
  torch_dtype=torch.bfloat16,
23
  trust_remote_code=True,
24
  device_map="auto",
 
6
  import spaces
7
  from transformers import AutoModelForCausalLM, AutoTokenizer, TextIteratorStreamer
8
 
9
+ MODEL_LIST = ["LGAI-EXAONE/EXAONE-3.0-7.8B-Instruct"]
10
+ HF_TOKEN = os.environ.get("HF_TOKEN", None)
11
+ MODEL = os.environ.get("MODEL_ID")
12
+
13
  DESCRIPTION = """ EXAONE-3.0-7.8B-Instruct Official Demo \
14
  """
15
 
 
19
 
20
  device = torch.device("cuda:0" if torch.cuda.is_available() else "cpu")
21
 
22
+ tokenizer = AutoTokenizer.from_pretrained(MODEL)
 
23
  model = AutoModelForCausalLM.from_pretrained(
24
+ MODEL,
25
  torch_dtype=torch.bfloat16,
26
  trust_remote_code=True,
27
  device_map="auto",