ariG23498 HF Staff commited on
Commit
a690f9d
·
verified ·
1 Parent(s): 636dc73

Upload DeepSeek-R1-0528 with huggingface_hub

Browse files
Files changed (1) hide show
  1. DeepSeek-R1-0528 +6 -9
DeepSeek-R1-0528 CHANGED
@@ -7,16 +7,13 @@
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="deepseek-ai/DeepSeek-R1-0528", trust_remote_code=True)
14
- messages = [
15
- {"role": "user", "content": "Who are you?"},
16
- ]
17
- pipe(messages)
18
  except Exception as e:
19
- exception_file = 'deepseek-ai_DeepSeek-R1-0528_0_exception.txt'
20
  with open(exception_file, 'w') as f:
21
  import traceback
22
  traceback.print_exc(file=f)
@@ -25,6 +22,6 @@ except Exception as e:
25
  upload_file(
26
  path_or_fileobj=exception_file,
27
  repo_id='model-metadata/model-code-exception',
28
- path_in_repo='09-07-25/deepseek-ai_DeepSeek-R1-0528_0_exception.txt',
29
  repo_type='dataset',
30
  )
 
7
  # ///
8
 
9
  try:
10
+ # Load model directly
11
+ from transformers import AutoTokenizer, AutoModelForCausalLM
12
 
13
+ tokenizer = AutoTokenizer.from_pretrained("deepseek-ai/DeepSeek-R1-0528", trust_remote_code=True)
14
+ model = AutoModelForCausalLM.from_pretrained("deepseek-ai/DeepSeek-R1-0528", trust_remote_code=True)
 
 
 
15
  except Exception as e:
16
+ exception_file = 'deepseek-ai_DeepSeek-R1-0528_1_exception.txt'
17
  with open(exception_file, 'w') as f:
18
  import traceback
19
  traceback.print_exc(file=f)
 
22
  upload_file(
23
  path_or_fileobj=exception_file,
24
  repo_id='model-metadata/model-code-exception',
25
+ path_in_repo='09-07-25/deepseek-ai_DeepSeek-R1-0528_1_exception.txt',
26
  repo_type='dataset',
27
  )