Shiro2 commited on
Commit
0eadf65
·
verified ·
1 Parent(s): a620053

Upload app1.py

Browse files
Files changed (1) hide show
  1. app1.py +4 -0
app1.py CHANGED
@@ -23,6 +23,10 @@ from transformers import AutoTokenizer, AutoModel
23
  from model.modeling_llada import LLaDAModelLM
24
 
25
  def chat(args):
 
 
 
 
26
  gen_length = args.gen_length
27
  steps = args.steps
28
  print('*' * 66)
 
23
  from model.modeling_llada import LLaDAModelLM
24
 
25
  def chat(args):
26
+ model = LLaDAModelLM.from_pretrained('GSAI-ML/LLaDA-8B-Instruct', trust_remote_code=True, torch_dtype=torch.float16, device_map = 'auto').eval()
27
+ tokenizer = AutoTokenizer.from_pretrained('GSAI-ML/LLaDA-8B-Instruct', trust_remote_code=True)
28
+ device = next(iter(model.parameters())).device.type
29
+
30
  gen_length = args.gen_length
31
  steps = args.steps
32
  print('*' * 66)