Upload google_embeddinggemma-300m_0.py with huggingface_hub
Browse files
google_embeddinggemma-300m_0.py
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# /// script
|
| 2 |
+
# requires-python = ">=3.12"
|
| 3 |
+
# dependencies = [
|
| 4 |
+
# "torch",
|
| 5 |
+
# "torchvision",
|
| 6 |
+
# "transformers",
|
| 7 |
+
# "accelerate",
|
| 8 |
+
# "peft",
|
| 9 |
+
# ]
|
| 10 |
+
# ///
|
| 11 |
+
|
| 12 |
+
try:
|
| 13 |
+
#@title Licensed under the Apache License, Version 2.0 (the "License");
|
| 14 |
+
# you may not use this file except in compliance with the License.
|
| 15 |
+
# You may obtain a copy of the License at
|
| 16 |
+
#
|
| 17 |
+
# https://www.apache.org/licenses/LICENSE-2.0
|
| 18 |
+
#
|
| 19 |
+
# Unless required by applicable law or agreed to in writing, software
|
| 20 |
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
| 21 |
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
| 22 |
+
# See the License for the specific language governing permissions and
|
| 23 |
+
# limitations under the License.
|
| 24 |
+
with open('google_embeddinggemma-300m_0.txt', 'w', encoding='utf-8') as f:
|
| 25 |
+
f.write('Everything was good in google_embeddinggemma-300m_0.txt')
|
| 26 |
+
except Exception as e:
|
| 27 |
+
with open('google_embeddinggemma-300m_0.txt', 'w', encoding='utf-8') as f:
|
| 28 |
+
import traceback
|
| 29 |
+
traceback.print_exc(file=f)
|
| 30 |
+
finally:
|
| 31 |
+
from huggingface_hub import upload_file
|
| 32 |
+
upload_file(
|
| 33 |
+
path_or_fileobj='google_embeddinggemma-300m_0.txt',
|
| 34 |
+
repo_id='model-metadata/code_execution_files',
|
| 35 |
+
path_in_repo='google_embeddinggemma-300m_0.txt',
|
| 36 |
+
repo_type='dataset',
|
| 37 |
+
)
|