ariG23498 HF Staff commited on
Commit
1c6770b
·
verified ·
1 Parent(s): 5e1e13d

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

Browse files
trillionlabs_Tri-70B-preview-SFT_1.py CHANGED
@@ -7,9 +7,14 @@
7
  # ///
8
 
9
  try:
10
- # Load model directly
11
- from transformers import AutoModelForCausalLM
12
- model = AutoModelForCausalLM.from_pretrained("trillionlabs/Tri-70B-preview-SFT", 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:
 
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: