ariG23498 HF Staff commited on
Commit
2a37f39
·
verified ·
1 Parent(s): ba8db7e

Upload facebook_MobileLLM-Pro_1.py with huggingface_hub

Browse files
Files changed (1) hide show
  1. facebook_MobileLLM-Pro_1.py +4 -16
facebook_MobileLLM-Pro_1.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="facebook/MobileLLM-Pro", trust_remote_code=True)
18
- messages = [
19
- {"role": "user", "content": "Who are you?"},
20
- ]
21
- pipe(messages)
22
  with open('facebook_MobileLLM-Pro_1.txt', 'w', encoding='utf-8') as f:
23
  f.write('Everything was good in facebook_MobileLLM-Pro_1.txt')
24
  except Exception as e:
@@ -33,14 +27,8 @@ except Exception as e:
33
  with open('facebook_MobileLLM-Pro_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="facebook/MobileLLM-Pro", 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
+ from huggingface_hub import login
15
+ login(new_session=False)
 
 
 
 
 
 
16
  with open('facebook_MobileLLM-Pro_1.txt', 'w', encoding='utf-8') as f:
17
  f.write('Everything was good in facebook_MobileLLM-Pro_1.txt')
18
  except Exception as e:
 
27
  with open('facebook_MobileLLM-Pro_1.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: