@@ -443,7 +443,7 @@ const _keras_hub_causal_lm = (modelId: string): string => `
443443import keras_hub
444444
445445# Load CausalLM model (optional: use half precision for inference)
446- causal_lm = keras_hub.models.CausalLM.from_preset(${ modelId } , dtype="bfloat16")
446+ causal_lm = keras_hub.models.CausalLM.from_preset(" ${ modelId } " , dtype="bfloat16")
447447causal_lm.compile(sampler="greedy") # (optional) specify a sampler
448448
449449# Generate text
@@ -454,7 +454,7 @@ const _keras_hub_text_to_image = (modelId: string): string => `
454454import keras_hub
455455
456456# Load TextToImage model (optional: use half precision for inference)
457- text_to_image = keras_hub.models.TextToImage.from_preset(${ modelId } , dtype="bfloat16")
457+ text_to_image = keras_hub.models.TextToImage.from_preset(" ${ modelId } " , dtype="bfloat16")
458458
459459# Generate images with a TextToImage model.
460460text_to_image.generate("Astronaut in a jungle")
@@ -465,7 +465,7 @@ import keras_hub
465465
466466# Load TextClassifier model
467467text_classifier = keras_hub.models.TextClassifier.from_preset(
468- ${ modelId } ,
468+ " ${ modelId } " ,
469469 num_classes=2,
470470)
471471# Fine-tune
@@ -480,7 +480,7 @@ import keras
480480
481481# Load ImageClassifier model
482482image_classifier = keras_hub.models.ImageClassifier.from_preset(
483- ${ modelId } ,
483+ " ${ modelId } " ,
484484 num_classes=2,
485485)
486486# Fine-tune
@@ -503,14 +503,14 @@ const _keras_hub_task_without_example = (task: string, modelId: string): string
503503import keras_hub
504504
505505# Create a ${ task } model
506- task = keras_hub.models.${ task } .from_preset(${ modelId } )
506+ task = keras_hub.models.${ task } .from_preset(" ${ modelId } " )
507507` ;
508508
509509const _keras_hub_generic_backbone = ( modelId : string ) : string => `
510510import keras_hub
511511
512512# Create a Backbone model unspecialized for any task
513- backbone = keras_hub.models.Backbone.from_preset(${ modelId } )
513+ backbone = keras_hub.models.Backbone.from_preset(" ${ modelId } " )
514514` ;
515515
516516export const keras_hub = ( model : ModelData ) : string [ ] => {
0 commit comments