Jakub Kwiatkowski commited on
Commit
6e28f48
·
1 Parent(s): 9502bdf

Add model_2.

Browse files
Files changed (1) hide show
  1. models_2.py +22 -0
models_2.py ADDED
@@ -0,0 +1,22 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import tensorflow as tf
2
+ from config_utils import tf_gpu
3
+ tf_gpu()
4
+ tf.experimental.numpy.experimental_enable_numpy_behavior(prefer_float32=True)
5
+
6
+ from huggingface_hub import from_pretrained_keras
7
+ from datasets import load_dataset
8
+
9
+ data = load_dataset("jkwiatkowski/raven", split="val")
10
+ model = from_pretrained_keras("jkwiatkowski/raven")
11
+
12
+ def convert(data):
13
+ return {
14
+ 'inputs': tf.cast(data['inputs'], dtype="uint8"),
15
+ 'index': tf.cast(data['index'], dtype="uint8"),
16
+ 'target': tf.cast(data['target'], dtype="int8"),
17
+ }
18
+
19
+ print("xD")
20
+
21
+
22
+