smdbs commited on
Commit
f6ed769
·
1 Parent(s): 64fc335

fix: change parameter type to be compatible on py3.9

Browse files
Files changed (1) hide show
  1. app.py +2 -1
app.py CHANGED
@@ -4,12 +4,13 @@ from huggingface_hub import InferenceClient
4
  import numpy as np
5
  from io import BytesIO
6
  import os
 
7
 
8
  # Make sure to set the environment variable HF_TOKEN to your Hugging Face token for using InferenceClient
9
  HF_TOKEN = os.environ.get("HF_TOKEN", "YOUR_HF_TOKEN")
10
  client = InferenceClient("microsoft/resnet-50", token=HF_TOKEN)
11
 
12
- def resnet50(image: np.ndarray | Image.Image | str | None) -> dict[str, float]:
13
  if image is None:
14
  return {}
15
 
 
4
  import numpy as np
5
  from io import BytesIO
6
  import os
7
+ from typing import Union
8
 
9
  # Make sure to set the environment variable HF_TOKEN to your Hugging Face token for using InferenceClient
10
  HF_TOKEN = os.environ.get("HF_TOKEN", "YOUR_HF_TOKEN")
11
  client = InferenceClient("microsoft/resnet-50", token=HF_TOKEN)
12
 
13
+ def resnet50(image: Union[np.ndarray, Image.Image, str, None]) -> dict[str, float]:
14
  if image is None:
15
  return {}
16