ariG23498 HF Staff commited on
Commit
b0781b6
·
verified ·
1 Parent(s): 2285fee

Upload mirth_chonky_mmbert_small_multilingual_1_1.py with huggingface_hub

Browse files
mirth_chonky_mmbert_small_multilingual_1_1.py CHANGED
@@ -19,17 +19,27 @@ try:
19
  with open('mirth_chonky_mmbert_small_multilingual_1_1.txt', 'w', encoding='utf-8') as f:
20
  f.write('Everything was good in mirth_chonky_mmbert_small_multilingual_1_1.txt')
21
  except Exception as e:
22
- with open('mirth_chonky_mmbert_small_multilingual_1_1.txt', 'w', encoding='utf-8') as f:
 
 
 
 
 
 
 
 
23
  import traceback
24
- traceback.print_exc(file=f)
 
 
25
 
26
- import os
27
- from slack_sdk import WebClient
28
- client = WebClient(token=os.environ['SLACK_TOKEN'])
29
- client.chat_postMessage(
30
- channel='#exp-slack-alerts',
31
- text='Problem in <https://huggingface.co/datasets/model-metadata/code_execution_files/blob/main/mirth_chonky_mmbert_small_multilingual_1_1.txt|mirth_chonky_mmbert_small_multilingual_1_1.txt>',
32
- )
33
  finally:
34
  from huggingface_hub import upload_file
35
  upload_file(
 
19
  with open('mirth_chonky_mmbert_small_multilingual_1_1.txt', 'w', encoding='utf-8') as f:
20
  f.write('Everything was good in mirth_chonky_mmbert_small_multilingual_1_1.txt')
21
  except Exception as e:
22
+ import os
23
+ from slack_sdk import WebClient
24
+ client = WebClient(token=os.environ['SLACK_TOKEN'])
25
+ client.chat_postMessage(
26
+ channel='#exp-slack-alerts',
27
+ text='Problem in <https://huggingface.co/datasets/model-metadata/code_execution_files/blob/main/mirth_chonky_mmbert_small_multilingual_1_1.txt|mirth_chonky_mmbert_small_multilingual_1_1.txt>',
28
+ )
29
+
30
+ with open('mirth_chonky_mmbert_small_multilingual_1_1.txt', 'a', encoding='utf-8') as f:
31
  import traceback
32
+ f.write('```CODE:
33
+ # Load model directly
34
+ from transformers import AutoTokenizer, AutoModelForTokenClassification
35
 
36
+ tokenizer = AutoTokenizer.from_pretrained("mirth/chonky_mmbert_small_multilingual_1")
37
+ model = AutoModelForTokenClassification.from_pretrained("mirth/chonky_mmbert_small_multilingual_1")
38
+ ```
39
+ ERROR:
40
+ ')
41
+ traceback.print_exc(file=f)
42
+
43
  finally:
44
  from huggingface_hub import upload_file
45
  upload_file(