ariG23498 HF Staff commited on
Commit
330d20f
·
verified ·
1 Parent(s): e498911

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

Browse files
Files changed (1) hide show
  1. google_gemma-3n-E4B-it_7.py +31 -0
google_gemma-3n-E4B-it_7.py ADDED
@@ -0,0 +1,31 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # /// script
2
+ # requires-python = ">=3.12"
3
+ # dependencies = [
4
+ # "transformers",
5
+ # "torch",
6
+ # ]
7
+ # ///
8
+
9
+ try:
10
+ from google.colab import output
11
+ output.enable_custom_widget_manager()
12
+
13
+ from ipywebrtc import AudioRecorder, CameraStream
14
+
15
+ camera = CameraStream(constraints={'audio': True,'video':False})
16
+ recorder = AudioRecorder(stream=camera)
17
+ recorder
18
+ with open('google_gemma-3n-E4B-it_7.txt', 'w') as f:
19
+ f.write('Everything was good in google_gemma-3n-E4B-it_7.txt')
20
+ except Exception as e:
21
+ with open('google_gemma-3n-E4B-it_7.txt', 'w') as f:
22
+ import traceback
23
+ traceback.print_exc(file=f)
24
+ finally:
25
+ from huggingface_hub import upload_file
26
+ upload_file(
27
+ path_or_fileobj='google_gemma-3n-E4B-it_7.txt',
28
+ repo_id='model-metadata/custom_code_execution_files',
29
+ path_in_repo='google_gemma-3n-E4B-it_7.txt',
30
+ repo_type='dataset',
31
+ )