Instructions to use detectivejoewest/diffusion-med-coco with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Keras
How to use detectivejoewest/diffusion-med-coco with Keras:
# !pip install -U keras tensorflow huggingface_hub # Keras needs TensorFlow installed to read "hf://" paths, so the tensorflow backend is selected here; # "jax" and "torch" also work for computation once TensorFlow is installed. import os os.environ["KERAS_BACKEND"] = "tensorflow" import keras model = keras.saving.load_model("hf://detectivejoewest/diffusion-med-coco") - Notebooks
- Google Colab
- Kaggle
Upload handler.py
Browse files- handler.py +4 -1
handler.py
CHANGED
|
@@ -1,4 +1,7 @@
|
|
| 1 |
-
import
|
|
|
|
|
|
|
|
|
|
| 2 |
from typing import Dict, Any
|
| 3 |
import numpy as np
|
| 4 |
import tensorflow as tf
|
|
|
|
| 1 |
+
from transformers import PreTrainedTokenizerFast
|
| 2 |
+
|
| 3 |
+
token2vec = PreTrainedTokenizerFast.from_pretrained("cl100k_tokenizer")
|
| 4 |
+
|
| 5 |
from typing import Dict, Any
|
| 6 |
import numpy as np
|
| 7 |
import tensorflow as tf
|