ariG23498 HF Staff commited on
Commit
6a7359b
·
verified ·
1 Parent(s): 7d2c329

Upload google_gemma-3n-E4B-it_9.py with huggingface_hub

Browse files
Files changed (1) hide show
  1. google_gemma-3n-E4B-it_9.py +32 -0
google_gemma-3n-E4B-it_9.py ADDED
@@ -0,0 +1,32 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # /// script
2
+ # requires-python = ">=3.12"
3
+ # dependencies = [
4
+ # "transformers",
5
+ # "torch",
6
+ # ]
7
+ # ///
8
+
9
+ try:
10
+ prompt = {
11
+ "role": "user",
12
+ "content": [
13
+ {"type": "image", "image": f"{RESOURCE_URL_PREFIX}GoldenGate.png"},
14
+ {"type": "audio", "audio": "/content/recording.wav"},
15
+ ]
16
+ }
17
+ chat = ChatState(model, processor)
18
+ chat.send_message(prompt)
19
+ with open('google_gemma-3n-E4B-it_9.txt', 'w') as f:
20
+ f.write('Everything was good in google_gemma-3n-E4B-it_9.txt')
21
+ except Exception as e:
22
+ with open('google_gemma-3n-E4B-it_9.txt', 'w') as f:
23
+ import traceback
24
+ traceback.print_exc(file=f)
25
+ finally:
26
+ from huggingface_hub import upload_file
27
+ upload_file(
28
+ path_or_fileobj='google_gemma-3n-E4B-it_9.txt',
29
+ repo_id='model-metadata/custom_code_execution_files',
30
+ path_in_repo='google_gemma-3n-E4B-it_9.txt',
31
+ repo_type='dataset',
32
+ )