ariG23498 HF Staff commited on
Commit
aca8c50
·
verified ·
1 Parent(s): a42cd5c

Upload moonshotai_Kimi-K2-Instruct_0.py with huggingface_hub

Browse files
Files changed (1) hide show
  1. moonshotai_Kimi-K2-Instruct_0.py +4 -0
moonshotai_Kimi-K2-Instruct_0.py CHANGED
@@ -20,6 +20,10 @@ try:
20
  {"role": "user", "content": "Who are you?"},
21
  ]
22
  pipe(messages)
 
 
 
 
23
  with open('moonshotai_Kimi-K2-Instruct_0.txt', 'w') as f:
24
  f.write('Everything was good in moonshotai_Kimi-K2-Instruct_0.txt')
25
  except Exception as e:
 
20
  {"role": "user", "content": "Who are you?"},
21
  ]
22
  pipe(messages)
23
+
24
+ # Load model directly
25
+ from transformers import AutoModelForCausalLM
26
+ model = AutoModelForCausalLM.from_pretrained("moonshotai/Kimi-K2-Instruct", trust_remote_code=True, torch_dtype="auto"),
27
  with open('moonshotai_Kimi-K2-Instruct_0.txt', 'w') as f:
28
  f.write('Everything was good in moonshotai_Kimi-K2-Instruct_0.txt')
29
  except Exception as e: