ariG23498 HF Staff commited on
Commit
3ca351e
·
verified ·
1 Parent(s): 54afad9

Upload inclusionAI_Ling-1T_1.py with huggingface_hub

Browse files
Files changed (1) hide show
  1. inclusionAI_Ling-1T_1.py +6 -16
inclusionAI_Ling-1T_1.py CHANGED
@@ -11,14 +11,9 @@
11
  # ///
12
 
13
  try:
14
- # Use a pipeline as a high-level helper
15
- from transformers import pipeline
16
-
17
- pipe = pipeline("text-generation", model="inclusionAI/Ling-1T", trust_remote_code=True)
18
- messages = [
19
- {"role": "user", "content": "Who are you?"},
20
- ]
21
- pipe(messages)
22
  with open('inclusionAI_Ling-1T_1.txt', 'w', encoding='utf-8') as f:
23
  f.write('Everything was good in inclusionAI_Ling-1T_1.txt')
24
  except Exception as e:
@@ -33,14 +28,9 @@ except Exception as e:
33
  with open('inclusionAI_Ling-1T_1.txt', 'a', encoding='utf-8') as f:
34
  import traceback
35
  f.write('''```CODE:
36
- # Use a pipeline as a high-level helper
37
- from transformers import pipeline
38
-
39
- pipe = pipeline("text-generation", model="inclusionAI/Ling-1T", trust_remote_code=True)
40
- messages = [
41
- {"role": "user", "content": "Who are you?"},
42
- ]
43
- pipe(messages)
44
  ```
45
 
46
  ERROR:
 
11
  # ///
12
 
13
  try:
14
+ # Load model directly
15
+ from transformers import AutoModelForCausalLM
16
+ model = AutoModelForCausalLM.from_pretrained("inclusionAI/Ling-1T", trust_remote_code=True, torch_dtype="auto")
 
 
 
 
 
17
  with open('inclusionAI_Ling-1T_1.txt', 'w', encoding='utf-8') as f:
18
  f.write('Everything was good in inclusionAI_Ling-1T_1.txt')
19
  except Exception as e:
 
28
  with open('inclusionAI_Ling-1T_1.txt', 'a', encoding='utf-8') as f:
29
  import traceback
30
  f.write('''```CODE:
31
+ # Load model directly
32
+ from transformers import AutoModelForCausalLM
33
+ model = AutoModelForCausalLM.from_pretrained("inclusionAI/Ling-1T", trust_remote_code=True, torch_dtype="auto")
 
 
 
 
 
34
  ```
35
 
36
  ERROR: