machineuser commited on
Commit
507971e
1 Parent(s): 08d6f91

Sync widgets demo

Browse files
packages/tasks/src/model-libraries-snippets.ts CHANGED
@@ -154,7 +154,10 @@ model = from_pretrained_keras("${model.id}")
154
  ];
155
 
156
  export const keras_nlp = (model: ModelData): string[] => [
157
- `import keras_nlp
 
 
 
158
 
159
  tokenizer = keras_nlp.models.Tokenizer.from_preset("hf://${model.id}")
160
  backbone = keras_nlp.models.Backbone.from_preset("hf://${model.id}")
 
154
  ];
155
 
156
  export const keras_nlp = (model: ModelData): string[] => [
157
+ `# Available backend options are: "jax", "tensorflow", "torch".
158
+ os.environ["KERAS_BACKEND"] = "tensorflow"
159
+
160
+ import keras_nlp
161
 
162
  tokenizer = keras_nlp.models.Tokenizer.from_preset("hf://${model.id}")
163
  backbone = keras_nlp.models.Backbone.from_preset("hf://${model.id}")