Upload custom_code/17-06-25/inclusionAI_Ming-Lite-Omni_0.py with huggingface_hub
Browse files
custom_code/17-06-25/inclusionAI_Ming-Lite-Omni_0.py
CHANGED
|
@@ -11,13 +11,15 @@ try:
|
|
| 11 |
from transformers import AutoModelForSeq2SeqLM
|
| 12 |
model = AutoModelForSeq2SeqLM.from_pretrained("inclusionAI/Ming-Lite-Omni", trust_remote_code=True)
|
| 13 |
except Exception as e:
|
| 14 |
-
|
|
|
|
| 15 |
import traceback
|
| 16 |
traceback.print_exc(file=f)
|
|
|
|
| 17 |
from huggingface_hub import upload_file
|
| 18 |
upload_file(
|
| 19 |
-
path_or_fileobj=
|
| 20 |
repo_id='model-metadata/model-code-exception',
|
| 21 |
-
path_in_repo=
|
| 22 |
repo_type='dataset',
|
| 23 |
)
|
|
|
|
| 11 |
from transformers import AutoModelForSeq2SeqLM
|
| 12 |
model = AutoModelForSeq2SeqLM.from_pretrained("inclusionAI/Ming-Lite-Omni", trust_remote_code=True)
|
| 13 |
except Exception as e:
|
| 14 |
+
exception_file = 'inclusionAI_Ming-Lite-Omni_0_exception.txt'
|
| 15 |
+
with open(exception_file, 'w') as f:
|
| 16 |
import traceback
|
| 17 |
traceback.print_exc(file=f)
|
| 18 |
+
# Upload exception log to HuggingFace
|
| 19 |
from huggingface_hub import upload_file
|
| 20 |
upload_file(
|
| 21 |
+
path_or_fileobj=exception_file,
|
| 22 |
repo_id='model-metadata/model-code-exception',
|
| 23 |
+
path_in_repo='17-06-25/inclusionAI_Ming-Lite-Omni_0_exception.txt',
|
| 24 |
repo_type='dataset',
|
| 25 |
)
|