ariG23498 HF Staff commited on
Commit
cc57b45
·
verified ·
1 Parent(s): 33865de

Upload meta-llama_Llama-3.1-8B-Instruct_0.py with huggingface_hub

Browse files
meta-llama_Llama-3.1-8B-Instruct_0.py CHANGED
@@ -11,14 +11,8 @@
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="meta-llama/Llama-3.1-8B-Instruct")
18
- messages = [
19
- {"role": "user", "content": "Who are you?"},
20
- ]
21
- pipe(messages)
22
  with open('meta-llama_Llama-3.1-8B-Instruct_0.txt', 'w', encoding='utf-8') as f:
23
  f.write('Everything was good in meta-llama_Llama-3.1-8B-Instruct_0.txt')
24
  except Exception as e:
@@ -32,17 +26,11 @@ except Exception as e:
32
 
33
  with open('meta-llama_Llama-3.1-8B-Instruct_0.txt', 'a', encoding='utf-8') as f:
34
  import traceback
35
- f.write('''
36
- ```CODE:
37
- # Use a pipeline as a high-level helper
38
- from transformers import pipeline
39
-
40
- pipe = pipeline("text-generation", model="meta-llama/Llama-3.1-8B-Instruct")
41
- messages = [
42
- {"role": "user", "content": "Who are you?"},
43
- ]
44
- pipe(messages)
45
  ```
 
46
  ERROR:
47
  ''')
48
  traceback.print_exc(file=f)
 
11
  # ///
12
 
13
  try:
14
+ from huggingface_hub import login
15
+ login(new_session=False)
 
 
 
 
 
 
16
  with open('meta-llama_Llama-3.1-8B-Instruct_0.txt', 'w', encoding='utf-8') as f:
17
  f.write('Everything was good in meta-llama_Llama-3.1-8B-Instruct_0.txt')
18
  except Exception as e:
 
26
 
27
  with open('meta-llama_Llama-3.1-8B-Instruct_0.txt', 'a', encoding='utf-8') as f:
28
  import traceback
29
+ f.write('''```CODE:
30
+ from huggingface_hub import login
31
+ login(new_session=False)
 
 
 
 
 
 
 
32
  ```
33
+
34
  ERROR:
35
  ''')
36
  traceback.print_exc(file=f)