ariG23498 HF Staff commited on
Commit
32359e1
·
verified ·
1 Parent(s): 03ccb14

Upload trillionlabs_Tri-70B-preview-SFT_1.py with huggingface_hub

Browse files
trillionlabs_Tri-70B-preview-SFT_1.py CHANGED
@@ -7,14 +7,9 @@
7
  # ///
8
 
9
  try:
10
- # Use a pipeline as a high-level helper
11
- from transformers import pipeline
12
-
13
- pipe = pipeline("text-generation", model="trillionlabs/Tri-70B-preview-SFT")
14
- messages = [
15
- {"role": "user", "content": "Who are you?"},
16
- ]
17
- pipe(messages)
18
  with open('trillionlabs_Tri-70B-preview-SFT_1.txt', 'w') as f:
19
  f.write('Everything was good in trillionlabs_Tri-70B-preview-SFT_1.txt')
20
  except Exception as e:
 
7
  # ///
8
 
9
  try:
10
+ # Load model directly
11
+ from transformers import AutoModelForCausalLM
12
+ model = AutoModelForCausalLM.from_pretrained("trillionlabs/Tri-70B-preview-SFT", trust_remote_code=True, torch_dtype="auto"),
 
 
 
 
 
13
  with open('trillionlabs_Tri-70B-preview-SFT_1.txt', 'w') as f:
14
  f.write('Everything was good in trillionlabs_Tri-70B-preview-SFT_1.txt')
15
  except Exception as e: